Answer the question
In order to leave comments, you need to log in
Trying to create Role and Permissions for a site with php artisan db:seed getting an error?
Error
$ php artisan db:seed
Seeding: RoleSeeder
Seeded: RoleSeeder (0.13 seconds)
Seeding: PermissionSeeder
Seeded: PermissionSeeder (0.18 seconds)
Seeding: UserSeeder
Illuminate\Database\QueryException
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into `users_roles` (`role_id`, `user_id`) values (1, ?))
Answer the question
In order to leave comments, you need to log in
$user2->roles()->attach($manager);
$user2->permissions()->attach($mangeUsers);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question