<li id="oyjrt"><acronym id="oyjrt"></acronym></li>
  • <rp id="oyjrt"></rp>

    <em id="oyjrt"><acronym id="oyjrt"></acronym></em>

      葵花寶典教程,一個自學編程平臺

      葵花寶典教程,一個自學編程平臺

      當 Target 類 [Controller] 不存在時怎么辦. 出現在 Laravel

      在最近的 Laravel(可能是 v8 或更高版本)中,如果你在初始狀態下在 routes/web.php 中編寫以下代碼,你將無法找到應該在那里的 Controller Class,并且會出現錯誤。

      Route::get('/hoge', 'Controller@index');
      Illuminate\Contracts\Container\BindingResolutionException Target class [Controller] does not exist.  http://laravel.internal/hoge  Illuminate\Container\Container::build htdocs\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:811

      顯然,我開始忘記了 Contoller 的初始位置。

      一致

      $namespace取消注釋App / Providers / RouteServiceProvider.php

          /**      
          * The controller namespace for the application.      *      
          * When present, controller route declarations will automatically be prefixed with this namespace.           
          * @var string|null      
          */     
          protected $namespace = 'App\\Http\\Controllers'; //


      第4條葵花寶典
      == ==

      Copyright www.texaschild-custody.com Rights Reserved葵花寶典教程.鄂icp2022001145號-1

      分享:

      支付寶

      微信

      亚洲日韩一级无码A片
      <li id="oyjrt"><acronym id="oyjrt"></acronym></li>
    1. <rp id="oyjrt"></rp>

      <em id="oyjrt"><acronym id="oyjrt"></acronym></em>