This error is occurring even though I am passing and retrieving the object properly. The error is in $dat. I am using it here :
<tr>
<th scope="row">{{$data->id}}</th>
<td>{{$dat->created_at}}</td>
</tr>
public function view_giftcard_data($id){
return view('admin.view_giftcard_data' , ['data' => Giftcards::where('id' , $id)->first() , 'dat' => Giftcard_codes::where('giftcard_id' , $id)]);
}
The name of table is correct.
<td>{{$dat->created_at}}</td>
? You're missing ana
on$dat
. – DigitalDrifter