/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Requests\VacationRequest $request) { $vacation = new Vacation_Request(); $vacation->start_at = $request->get('start_date'); $vacation->end_at = $request->get('end_date'); $vacation->type = $request->get('type'); $vacation->user_id = Auth::user()->id; $vacation->save(); return redirect()->action('VacationController@index'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id, $approve) { $vacation = \App\Vacation_Request::find($id); $vacation->approved = $approve; $vacation->save(); return redirect()->action('ApprovalController@index'); }