/** * Boot the service provider. * @return void */ public function boot() { $this->app[Kernel::class]->pushMiddleware(Middleware::class); $this->loadViewsFrom(__DIR__ . '/../resources/views', 'backend_auth'); $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module'); $this->publishes([__DIR__ . '/../config/config.php' => config_path('module.php')], 'config'); $this->publishes([__DIR__ . '/../config/auth.php' => config_path('auth.php')], 'config'); $this->publishes([__DIR__ . '/../public' => public_path('backend_auth')], 'public'); $this->publishes([__DIR__ . '/../migrations/' => database_path('migrations')], 'migrations'); require __DIR__ . '/routes.php'; pusher('user_menu', 'backend_auth::user_menu'); pusher('sidebar', 'backend_auth::sidebar', [], 2); pusher('widgets', 'backend_auth::user_widget', ['users' => User::all()]); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return BackUser::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }
/** * Run the database seeds. * * @return void */ public function run() { \Scrobot\BackendAuth\User::create(['username' => 'administrator', 'password' => \Hash::make('crhj,jn91'), 'email' => '*****@*****.**', 'level' => 0]); }
public function getDestroy($id) { BackUser::destroy($id); return back(); }
public function postUpdate(UserStorePostRequest $request, $id) { $user = User::find($id); $user->update($request->all()); return back()->withMsg('Данные успешно обновлены'); }