app/Http/Controllers/Create_tripController.php
//show members of trips using trip_id
show members of trips using trip_id
show members of trips using trip_id
public function show_members($trip_id)
    {
        $user_email= Trip_participation::where('trip_id',$trip_id)->get('email')->distinct();
        $user = array();
        $i=1;
        foreach ($user_email as $key => $email)
        {
             $user[$i] = User::where('email',$user_email)->first();
             $i++;
        }
        return response()->json($user);
    }
public function show_members ( $ trip_id ) { $ user_email = Trip_participation :: where ( 'trip_id' , $ trip_id ) -> get ( 'email' ) -> distinct ( ) ; $ user = array ( ) ; $ i = 1 ; foreach ( $ user_email as $ key => $ email ) { $ user [ $ i ] = User :: where ( 'email' , $ user_email ) -> first ( ) ; $ i ++ ; } return response ( ) -> json ( $ user ) ; }
show members of trips using trip_id
show members of trips using trip_id