Ejemplo n.º 1
0
 /**
  * @param RoleRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(RoleRequest $request)
 {
     try {
         DB::transaction(function () use($request) {
             $this->repository->create($request->all());
         });
     } catch (ValidatorException $e) {
         return redirect()->back()->withErrors($e->getMessageBag());
     }
     SweetAlert::success(trans('LaravelAdmin::laravel-admin.rolCreationSuccess'));
     return redirect()->to(config('laravel-admin.routePrefix', 'backend') . '/roles');
 }
Ejemplo n.º 2
0
 public function store(RoleRequest $request)
 {
     $this->model->create($request->all());
     flash()->success(trans('LaravelAdmin::laravel-admin.rolCreationSuccess'));
     return Redirect::to('backend/roles');
 }