/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, Request $request) { //$this->validate($request, ['name' => 'required']); // Uncomment and modify if needed. $agent = Agent::findOrFail($id); $agent->update($request->all()); return redirect('admin/agents')->with('success', Lang::get('message.success.update')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { DB::transaction(function () use($id) { $user = Auth::user(); $agent = Agent::findOrFail($id); $agent->updated_by = $user->name; $agent->deleted_by = $user->name; $agent->key = $agent->key . '-' . microtime(true); $agent->save(); // soft delete $agent->delete(); }); }
/** * Shows some of the information of a particular user * based on the user's ID * if no user is found based on ID, it will gracefully fail * @todo * shold only be available to Admin * things such as password should not appear? * */ public function show($id) { $agent = Agent::findOrFail($id); return view('agent.show', compact('agent')); }