app/Http/Controllers/Backend/VerifyLockController.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($id)
    {
        $a = Booking::where('id' , $id)->update(['verify' => 1]);
        $b = BookingDetail::where('bookingID' , $id)->update(['verify' => 1]);
        if($a <= 0 || $b <= 0) return response()->json(['result' => false, 'message' => 'can not find this booking.']);
        $temp_booking = ViewBookingAndDetail::where('active' , 1)
            ->where('id' , $id)
            ->groupBy('id')
            ->orderBy('zoneNumber')
            ->get();
       foreach ($temp_booking as $key => $value) {
            $value->detail = BookingDetail::where('bookingID' ,$value->id )->get();
            $value->user = User::where('id' , $value->userID )->first();
        }
        return  response()->json(['result' => true, 'message' => 'success', 'data' =>  $temp_booking]);
    }
public function update ( $ id ) { $ a = Booking :: where ( 'id' , $ id ) -> update ( [ 'verify' => 1 ] ) ; $ b = BookingDetail :: where ( 'bookingID' , $ id ) -> update ( [ 'verify' => 1 ] ) ; if ( $ a <= 0 || $ b <= 0 ) return response ( ) -> json ( [ 'result' => false , 'message' => 'can not find this booking.' ] ) ; $ temp_booking = ViewBookingAndDetail :: where ( 'active' , 1 ) -> where ( 'id' , $ id ) -> groupBy ( 'id' ) -> orderBy ( 'zoneNumber' ) -> get ( ) ; foreach ( $ temp_booking as $ key => $ value ) { $ value -> detail = BookingDetail :: where ( 'bookingID' , $ value -> id ) -> get ( ) ; $ value -> user = User :: where ( 'id' , $ value -> userID ) -> first ( ) ; } return response ( ) -> json ( [ 'result' => true , 'message' => 'success' , 'data' => $ temp_booking ] ) ; }
Update the specified resource in storage.
Update the specified resource in storage .