public function run() { DB::table('roles')->delete(); Model::unguard(); \ZaLaravel\LaravelUser\Models\Role::create(['name' => 'admin']); \ZaLaravel\LaravelUser\Models\Role::create(['name' => 'moderator']); \ZaLaravel\LaravelUser\Models\Role::create(['name' => 'user']); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit(UserInterface $user) { $roles = Role::orderBy('id', 'asc')->get(); return view('laravel-user::edit', ['user' => $user, 'roles' => $roles, 'action' => 'edit']); }