/** * @param Requests\CreateUserRequest $request * @return mixed */ public function store(Requests\CreateUserRequest $request) { try { DB::transaction(function () use($request) { $this->repository->create($request->all()); }); } catch (ValidatorException $e) { return redirect()->back()->withErrors($e->getMessageBag())->withInput(); } SweetAlert::success(trans('LaravelAdmin::laravel-admin.userCreated')); return redirect(config('laravel-admin.routePrefix', 'backend') . '/users'); }
public function store(Requests\CreateUserRequest $request) { $this->userRepository->create($request->all()); flash()->success(trans('LaravelAdmin::laravel-admin.userCreated')); return Redirect::to('backend/users'); }