コード例 #1
0
 /**
  * @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');
 }
コード例 #2
0
 public function store(Requests\CreateUserRequest $request)
 {
     $this->userRepository->create($request->all());
     flash()->success(trans('LaravelAdmin::laravel-admin.userCreated'));
     return Redirect::to('backend/users');
 }