LoginSignup
0
0

More than 3 years have passed since last update.

laravel Controller作成時 ReflectionException

Posted at

App\Http\Controllers\〇〇がある場合

# php artisan make:controller 〇〇/<Controller名>

このようにコントローラを作成してあげると、App\Http\Controllers配下のディレクトリにコントローラが作成され、名前空間(namespace)も自動的に記述される。

作成直後にReflectionExceptionが出る場合

App\Http\Controllers\〇〇.php
use App\Models\<モデルクラス>;
use App\Http\Controllers\Controller;

この2つをuseすることが最低限必要そうです。
どちらかが記述されていないと、php artisan route:listなどが機能しません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0