/** * Insert. * * Insert a new trip into the system. * * @param Requests\tripValidation $request */ public function insert(tripValidation $request) { $data = array_add($request->except('_token'), 'user_id', Auth::user()->id); // Mass assignement. the field names in the forms are equal to the database columns. Trips::create($data); session()->flash('flash_title', 'Success!'); session()->flash('flash_message', 'U heeft een rit ingevoegd.'); session()->flash('flash_message_important', false); return Redirect::back(); }