Laravel 5: 未找到 DB 种子类
2022-08-30 13:28:33
我有这个数据库搜索者.php:
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call('MemberInvitationSeeder');
}
}
我有这个文件 MemberInvitationSeeder.php,与 DatabaseSeeder 同级.php文件
<?php
use Illuminate\Database\Seeder;
use App\MemberInvitation;
class MemberInvitationSeeder extends Seeder {
public function run()
{
MemberInvitation::truncate();
MemberInvitation::create( [
'id' => 'BlahBlah' ,//com_create_guid(),
'partner_id' => 1,
'fisrt_name' => 'Thats',
'last_name' => 'Me',
'email' => 'me@mymail.com',
'mobile_phone' => '444-342-4234',
'created_at' => new DateTime
] );
}
}
现在我打电话
php artisan db:seed
我得到:
[ReflectionException]
Class MemberInvitationSeeder does not exist
我尝试了我能找到的一切,包括“作曲家转储自动加载”。无济于事。我做错了什么?