我们在进行多人开发时, 发现运行 PHP artisan db:seed --class = 填充器名称
发现有报错
- 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 自动加载. 就可以了. 因为填充器不是由我们创建的, 是拉取代码时 "创建的".
来源: http://www.bubuko.com/infodetail-3035527.html