app/Http/Controllers/EventController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $events = Event::with('dates')->get()->sortByDesc('dates.datetime');
        return view('event.index', compact('events'));
    }
public function index ( ) { $ events = Event :: with ( 'dates' ) -> get ( ) -> sortByDesc ( 'dates.datetime' ) ; return view ( 'event.index' , compact ( 'events' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .