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!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2sa9uO3
via IFTTT

Aucun commentaire:

Enregistrer un commentaire