        return view('ride.index', compact('rides'));
    }

    public function sortByJoinDown(Request $request)
    {
        $rides = Ride::with('status')
            ->orderBy(Status::select('status')
            ->whereColumn('statuses.id', 'rides.status_id'), 'desc')
            ->paginate(10);
        return view('ride.index', compact('rides'));
    }

    public function sortByStartDateUp(Request $request)
    {