public function run() { $permissions = array('Manage Users', 'Manage Articles', 'Manage Pages', 'Manage Categories', 'Manage Settings', 'Manage Roles', 'Manage Permissions'); foreach ($permissions as $permission) { Permission::create(['name' => $permission, 'slug' => $permission, 'description' => $permission]); } $permissions = Permission::lists('id'); Role::find(1)->permissions()->attach($permissions); }
public function run() { Role::create(['name' => 'Administrator', 'slug' => 'admin']); Role::create(['name' => 'User', 'slug' => 'user']); }