How with eloquent pull lists and sorted connected tasks to those list(something like this
$classes = Classes::find(1)->student;
but for all lists(for example I thought this will work but sadly no)
$lists = Lists::all()->task;
How with eloquent pull lists and sorted connected tasks to those list(something like this
$classes = Classes::find(1)->student;
but for all lists(for example I thought this will work but sadly no)
$lists = Lists::all()->task;
Assuming that a task belongs to a list, you can do it like so :
foreach(Lists::all() as $list) {
// do something with $list->task
}