app/Http/Controllers/LeaveController.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 updateTotalLeave(Request  $request, $id)
    {
        $leaves = Leaves::findOrFail($id);
        $leaves->total = $request->diffDays;
        $leaves->save();
        return response()->json(['Message'=>'success', 'status'=>(int)true]);
    }
public function updateTotalLeave ( Request $ request , $ id ) { $ leaves = Leaves :: findOrFail ( $ id ) ; $ leaves -> total = $ request -> diffDays ; $ leaves -> save ( ) ; return response ( ) -> json ( [ 'Message' => 'success' , 'status' => ( int ) true ] ) ; }
Update the specified resource in storage.
Update the specified resource in storage .