I solved the problem. I created a pivot table role_user
seed using:
php artisan generate:seed role user
and in RoleUserTableSeeder
I type that:
$adminRole = Role::where('name','=','Admin')->first()->id;
$userRole = Role::where('name','=','Registred user')->first()->id;
$admin = User::where('username','=','admin')->first()->id;
$user = User::where('username','=','user')->first()->id;
$role_user = array(
array('role_id' => $adminRole, 'user_id'=>$admin, 'active'=>1, 'created_at' => new DateTime, 'updated_at' => new DateTime,),
array('role_id' => $userRole, 'user_id'=>$user, 'active'=>1, 'created_at' => new DateTime, 'updated_at' => new DateTime,)
);
// Uncomment the below to run the seeder
DB::table('role_user')->insert($role_user);
And db:seed
work perfectly.