/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $characteristic = new Amenity($request->all()); $characteristic->save(); return view('admin.control.admin', compact('user_role')); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request, Redirector $redirector) { $this->validate($request, ['category' => 'required', 'amenity' => 'required']); $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $characteristic = new Amenity($request->all()); $characteristic->save(); return $redirector->back(); }