/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { try { $positions = Position::paginate(env('LIMIT', 15)); $position = Position::findOrFail($id); } catch (ModelNotFoundException $ex) { Flash::error('No position available' . $ex); return redirect()->route('positions.index'); } return view('positions.index', compact('position', 'positions')); }