我正在遵循Code Forest的教程,当使用php artisan db:seed
时,我得到这个错误:
PHP Fatal Error: Class 'Sentry' not found in/var/www/app/database/seeds/sentryseed . PHP第13行
这里是SentrySeeder.php:
<?php
use AppModelsUser;
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);
}
}
这里是User model
Sentry已添加到应用程序下的提供商我错过了什么?
你添加岗哨的外观了吗?
添加'Sentry' => 'CartalystSentryFacadesLaravelSentry',
到config/app.php
将'CartalystSentrySentryServiceProvider'添加到app/config/app.php中的服务提供商列表
我必须在app/config/app.php文件中添加这两个:
1。
'Sentry' => ' catalyst SentryFacadesLaravelSentry',
到:'aliases' =>数组(
)和
2。
Cartalyst 哨兵 SentryServiceProvider,
到:'providers' =>数组(