我们在进行多人开发时,发现运行php artisan db:seed --class=填充器名称

发现有报错

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
 Exception trace:

  1   ReflectionClass::__construct("LinksTableSeeder")
      D:\phpStudy\PHPTutorial\WWW\blog\vendor\laravel\framework\src\Illuminate\Container\Container.php:794

  2   Illuminate\Container\Container::build("LinksTableSeeder")
      D:\phpStudy\PHPTutorial\WWW\blog\vendor\laravel\framework\src\Illuminate\Container\Container.php:671

  Please use the argument -v to see more details.

  明明命令没错。

后来php artisan db:seed --class=填充器名称运行前,先运行 composer dump-autoload 自动加载。就可以了。因为填充器不是由我们创建的,是拉取代码时“创建的”。

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄