Detaliicommat
Comenzimaterial
@foreach($orders as $order)
<p>{{ $order->Poz }}
{{ $order->Nrcommat }}
{{ $order->Data }}</p>
{{ $order->details }}
@endforeach
$order-details return an array with all the data..but i can't access $order->details->Nrcommat etc.
I solved it.. If someone else has this problem.. I've dd($order->details) and notices that my foreign key was set to orders_id..and my foreign key should be Nrcommat.
public function orders()
{
return $this->belongsTo('App\Orders', 'Nrcommat', 'Nrcommat');
}
same for details method. Thank you for help.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community