mardi 3 avril 2018

Laravel 5.4 get relations from collection

I have the next eloquent query with relations, what I want to do is get 'solicitud' array from the collection, is it possible ?

$requests = Request_conversation::with(['solicitud', 'solicitud.reservation', 'solicitud.detail.subDetails'])->
                where('readed', '=', 0)
                ->whereHas('solicitud', function($q)use($user){
                    $q->where('idUsuario','=', $user);
                })
                ->skip($inicio)
                ->take($elementos)
                ->groupBy('solicitud')
                ->orderBy('created_at', 'DESC')->get();



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

Aucun commentaire:

Enregistrer un commentaire