/** * Run the database seeds. * * @return void */ public function run() { $permissions = R::allPermissions(); foreach ($permissions as $name => $display_name) { Permission::create(compact('name', 'display_name')); } }
/** * Run the database seeds. * * @return void */ public function run() { $rolesWithPermissions = R::rolesWithPermissions(); foreach ($rolesWithPermissions as $roleName => $permissions) { $role = Role::whereName($roleName)->first(); foreach ($permissions as $permissionName) { $permission = Permission::whereName($permissionName)->first(); $role->assignPermission($permission); } } }