I store Event and Event Schedules are tow different Tables. I Display Event by Event Schedule Date Ascending. I use the following Query Its not Display Correctly.
$eventslist=Events::with(['eventschedule' => function($query) { $query->orderBy('eventdate', 'ASC'); }])->paginate($this->recordsperpage);
In Event Model :
public function eventschedule(){
return $this->hasMany('App\Eventshcedule','events_id','id')->orderBy('eventdate', 'ASC');
}
I need to display events by Date wise asending.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire