app/Http/Controllers/Create_tripController.php
//we have to design a interface such that only trip organiser can see create , update and delete forms.
we have to design a interface such that only trip organiser can see create , update and delete forms.
we have to design a interface such that only trip organiser can see create update and delete forms .
public function createTrip(Request $request)
    {
        $api_token=$request->api_token;
        if(User::where('api_token','=',$api_token)->where('type','=','trip organiser')->exists())
        {
                    $trip = Create_trip::create($request->all());
                    return response()->json($trip,200);
          }
          return response("YOU DON'T HAVE PROPER PERMISSION",401);
    }
public function createTrip ( Request $ request ) { $ api_token = $ request -> api_token ; if ( User :: where ( 'api_token' , '=' , $ api_token ) -> where ( 'type' , '=' , 'trip organiser' ) -> exists ( ) ) { $ trip = Create_trip :: create ( $ request -> all ( ) ) ; return response ( ) -> json ( $ trip , 200 ) ; } return response ( " YOU DON'T HAVE PROPER PERMISSION " , 401 ) ; }
we have to design a interface such that only trip organiser can see create , update and delete forms.
we have to design a interface such that only trip organiser can see create update and delete forms .
//     Trip::create($request->all()); //    Checkpoints::create([ //        'trip_id' => $request->trip_id, //        'checkpoint_no' => 'source', //        'checkpoint' => $request->source, //    ]); //    Checkpoints::create([ //        'trip_id' => $request->trip_id, //        'checkpoint_no' => 'destination', //        'checkpoint' => $request->destination, //    ]); //    return response($request, 200);