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();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire