When you use DB('table_name')->get() it returns a Collection that means it is a Class you should use $item->name instead of $item['name']
But if you want keep use array syntax then change this line:
$data['items'] = DB::table('items')->get();
to be:
$data['items'] = DB::table('items')->get()->toArray() // Or ->all();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community