2015-08-25 63 views
0

我正在使用Package在我的laravel 5.1應用程序中進行角色和權限管理,並在嘗試使用以下代碼創建角色時出現錯誤。在使用包時獲取ReflectionException

<?php 

use Bican\Roles\Models\Role; 

use Illuminate\Database\Seeder; 

class RoleTableSeeder extends Seeder 
{ 
public function run() 
{ 
$adminRole = Role::create([ 
'name' => 'Admin', 
'slug' => 'admin', 
'description' => '', // optional 
'level' => 1, // optional, set to 1 by default 
]); 
} 
} 

我在CLI上使用以下命令爲它播種。

php artisan db:seed --class=RoleTableSeeder 

但不幸的是我得到ReflectionException

「[ReflectionException]類RoleTableSeeder不存在」 ...

什麼可能是錯誤的呢?尋找你的幫助...

鏈接包裝:https://github.com/romanbican/roles

回答

0

問題上使用CLI以下命令解決。

composer dump-autoload 

確認:包所有者