app/Http/Controllers/Api/BookingController.php
/**
     * Show a listing of available trips.
     *
     * @param \Illuminate\Http\Request $request
     * @return \Illuminate\Contracts\Support\Renderable
     */
Show a listing of available trips.
Show a listing of available trips .
public function trips(Request $request)
    {
        $trips = Trip::with(['stations' => fn ($q) => $q->orderBy('station_trip.stop_order')])->paginate(abs($request->per_page));
        return $this->success($trips);
    }
public function trips ( Request $ request ) { $ trips = Trip :: with ( [ 'stations' => fn ( $ q ) => $ q -> orderBy ( 'station_trip.stop_order' ) ] ) -> paginate ( abs ( $ request -> per_page ) ) ; return $ this -> success ( $ trips ) ; }
Show a listing of available trips.
Show a listing of available trips .