samedi 26 mai 2018

How to have query by 3 join in Laravel Eloquent model without foreach

Is there anyway to remove to foreach from this code?

    $user = \Auth::user();
    foreach ($user->categories as $category) {
        $channels[] = $category->channel();
    }
    return $channels;

I want to use the paginate function but it's not possible with the foreach!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire