app/Http/Controllers/Create_tripController.php
//if user wants to join and press JOIN THIS TRIP button then request will send to trip_organiser then trip_org add that user into trip  and notify him the same.
if user wants to join and press JOIN THIS TRIP button then request will send to trip_organiser then trip_org add that user into trip  and notify him the same.
if user wants to join and press JOIN THIS TRIP button then request will send to trip_organiser then trip_org add that user into trip and notify him the same .
public function add_user_to_trip(Request $request)     
    {
        $api_token=$request->api_token;
        if(User::where('api_token','=',$api_token)->where('type','=','trip organiser')->exists())
         {
                    $trip = Trip_participation::create($request->all());
                    return response()->json($trip,200);
          }
          return response("WAIT FOR TRIP_ORG RESPONSE",401);
    }
public function add_user_to_trip ( Request $ request ) { $ api_token = $ request -> api_token ; if ( User :: where ( 'api_token' , '=' , $ api_token ) -> where ( 'type' , '=' , 'trip organiser' ) -> exists ( ) ) { $ trip = Trip_participation :: create ( $ request -> all ( ) ) ; return response ( ) -> json ( $ trip , 200 ) ; } return response ( " WAIT FOR TRIP_ORG RESPONSE " , 401 ) ; }
if user wants to join and press JOIN THIS TRIP button then request will send to trip_organiser then trip_org add that user into trip  and notify him the same.
if user wants to join and press JOIN THIS TRIP button then request will send to trip_organiser then trip_org add that user into trip and notify him the same .
//or fill Trip_participation table.