Beispiel #1
0
 /**
  * Register the user.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return $this|\Illuminate\Http\RedirectResponse
  */
 public function registration(Request $request)
 {
     if (!config('laraflock.dashboard.registration')) {
         Flash::error(trans('dashboard::dashboard.flash.registration.not_active'));
         return redirect()->route('auth.login');
     }
     try {
         $this->authRepositoryInterface->register($request->all());
     } catch (FormValidationException $e) {
         Flash::error($e->getMessage());
         return redirect()->route('auth.register')->withErrors($e->getErrors())->withInput();
     } catch (RolesException $e) {
         Flash::error($e->getMessage());
         return redirect()->route('auth.register')->withInput();
     }
     if (!config('laraflock.dashboard.activations')) {
         Flash::success(trans('dashboard::dashboard.flash.registration.activated'));
         return redirect()->route('auth.login');
     }
     Flash::success(trans('dashboard::dashboard.flash.registration.created'));
     return redirect()->route('auth.login');
 }