Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     try {
         $agent = Agent::with('agent_category')->findOrFail($id);
     } catch (ModelNotFoundException $e) {
         $errMsg = "Cannot find agent! Error on `edit` with ID={$id}";
         return redirect('masterdata/agent')->with('errMsg', $errMsg);
     }
     return view('masterdata/agent-form', ['agent' => $agent, 'agent_cat' => AgentCategory::all(), 'method' => 'PUT', 'form_action' => action('AgentController@update', $agent->id), 'agent_id' => $id]);
 }
Exemplo n.º 2
0
 /**
  * Display a listing of agent categories
  *
  * @return Response
  */
 public function index()
 {
     $categories = AgentCategory::all();
     return view('masterdata/agent-cat-table', ['agent_cat' => $categories]);
 }