public function store(Request $request) { try { $word = new Word(); $word->assignValues($request); session()->flash('flash_success', 'Adding of word successful!'); } catch (Exception $e) { session()->flash('flash_error', 'Adding of word failed.'); } return redirect('/words'); }