我正在关注Code Forest的教程,在使用时php artisan db:seed
,我收到此错误:
PHP 致命错误:在第 13 行的 /var/www/app/database/seeds/SentrySeeder.php 中找不到类 'Sentry'
这是 SentrySeeder.php :
<?php
use App\Models\User;
class SentrySeeder extends Seeder {
public function run()
{
DB::table('users')->delete();
DB::table('groups')->delete();
DB::table('users_groups')->delete();
Sentry::getUserProvider()->create(array(
'email' => 'admin@admin.com',
'password' => "admin",
'first_name' => 'John',
'last_name' => 'McClane',
'activated' => 1,
));
Sentry::getGroupProvider()->create(array(
'name' => 'Admin',
'permissions' => array('admin' => 1),
));
// Assign user permissions
$adminUser = Sentry::getUserProvider()->findByLogin('admin@admin.com');
$adminGroup = Sentry::getGroupProvider()->findByName('Admin');
$adminUser->addGroup($adminGroup);
}
}
这是用户模型
Sentry 已添加到提供程序下的应用程序中我缺少什么?