/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(Request $request, $id) { Teammate::find($id)->update($request->all()); return redirect('teammates')->with('status', 'Teammate updated!'); }
/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); Teammate::create(['full_name' => 'Fakhar Zaman Khan', 'father_name' => 'Munir Ahamed Khan', 'date_of_birth' => '1980-02-18', 'date_of_joining' => '2013-10-10', 'designation' => 'CEO', 'months_of_confirmation' => '1', 'months_of_increment' => '12', 'basic_pay' => '50000', 'email' => '*****@*****.**', 'phone_mobile' => '03224058008', 'phone_home' => '3569797', 'address1' => '32 A Ferozpur road', 'address2' => '', 'city' => 'Lahore', 'elance_user_id' => '2499639']); Model::reguard(); }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request, $teammate) { $teammate = Teammate::find($teammate); $teammate->leaves()->save(new Leave($request->all())); return redirect()->route('teammates.{teammate}.leaves.index', [$teammate->id])->with('status', 'Leave created!'); }