app/Http/Controllers/Admin/leavesController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(LeavesValidator $request, $id)
    {
        $data= $request->all();
        $leaves = Leaves::findorfail($id);
        $leaves->update($data);
        if(!$data){
        return redirect()->back()->with('error','Sorry the changes couldn\t be made');
    }else{
        return redirect()->route('employeeLeaveView')->with('success', 'Leave Details Updated Successfully !!!');
    }
}
public function update ( LeavesValidator $ request , $ id ) { $ data = $ request -> all ( ) ; $ leaves = Leaves :: findorfail ( $ id ) ; $ leaves -> update ( $ data ) ; if ( ! $ data ) { return redirect ( ) -> back ( ) -> with ( 'error' , 'Sorry the changes couldn\t be made' ) ; } else { return redirect ( ) -> route ( 'employeeLeaveView' ) -> with ( 'success' , 'Leave Details Updated Successfully !!!' ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .