/** * Store a newly created resource in storage. * * @return Response */ public function store() { $validation = $this->validator(Request::all()); if ($validation->fails()) { return redirect()->back()->withInput(Request::all())->withErrors($validation); } $data = Request::only($this->requiredkeys()); $data['password'] = bcrypt($data['password']); $guard = User::createGuard($data); return redirect(route('guard.show', ['id' => $guard->id]))->with('success', 'Added Successfully'); }