16
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Target class [〇〇〇TableSeeder] does not exist. って出てきたときにやったこと。

Posted at

事象

Seederファイルに目的のデータを追加して、
DatabaseSeeder.phpにも追加。
php artisan migrate:refresh --seed を実行。

 Illuminate\Contracts\Container\BindingResolutionException  : Target class [XxxxxTableSeeder] does not exist.

なぜかエラーに。
typoを疑い、探してみるも見つけられず。

原因

composerのリロードが必要だったようです。

composer dump-autoload
# リロードした後に再作成。
php artisan migrate:refresh --seed

今度は問題なく再作成することができました。
〜〜 does not exist のようなエラーは、変にググるよりキャッシュを疑った方が効率的ですね!

php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
composer dump-autoload
16
10
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
16
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?