我有不同的文件夹中的数据库播种器clases.当我写db:seed时,控制台显示以下错误:
原文链接:https://www.f2er.com/laravel/130353.html[ReflectionException] Class DatabaseSeeder does not exist,Laravel Seeder
一类是这样的:
namespace Database\Seeds; use Illuminate\Support\Facades\DB; use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; use TiposCompromisosTableSeeder; class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->call('TiposCompromisosTableSeeder'); } }
我的另一课是
namespace Database\Seeds; use Illuminate\Support\Facades\DB; use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; class TiposCompromisosTableSeeder extends Seeder{ public function run(){ DB::table('tipos')->insert(array( 'nombre' => 'prioridad','tabla' => 'compromisos','str1' => 'baja','int1' => 1 )); } }
我试过用
composer dump-autoupload
但不起作用.
如您所见,我在同一名称空间中有两个clases.
请帮忙.