Hi, I have a query in Laravel 5.5 that brings me what I need with the related data of 2 tables. My query is as follows:
$facturas = ProgramacionPagos::select('*')
->where([
['pagorealizado' , '0'], ['autorizado_cxp', '!=' , NULL]
])
->with('files')
->with('comments')
->get();
and if you bring what I need from the following address:
What I want is to be able to access the values of the related tables. I've tried to do it with
@foreach($facturas as $k => $factura)
$factura->files->id
but I get an error. Someone who can help me