this is my code in the controller
$order = Order::with(['media','contact'])
->get();
and this is my code in the view and it work fine
<label> {{__($order['details'])}} </label>
but if I change the attribute to timestamp attribute like 'created_at' , 'updated_at' I got this error
Illegal offset type
note that: the code in the view is inside foreach
$order
is aCollection
;->get()
returns multipleOrder
objects. If you're not already, you need to loop them, like@foreach($orders as $order)
, and prefer to useobject
syntax:$order->details
instead ofarray
syntax$order['details']
(although both are allowed, objects is preferred) – Tim Lewis