/** * Store a newly created resolution in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), Resolution::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $enquiry = Enquiry::findOrFail(Input::get('enquiry_id')); $resolution = new Resolution(); $resolution->enquiry()->associate($enquiry); $resolution->date = date('Y-m-d'); $resolution->resolution = Input::get('resolution'); $resolution->save(); return Redirect::to('enquiries/show/' . $resolution->enquiry->id); }