I have an object in laravel 5.5 $categories that looks like this...
Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => App\Category Object
(
[table:protected] => categories
[primaryKey] => id
[attributes:protected] => Array
(
[id] => 22
[title] => Fruit
[slug] => fruit
)
[original:protected] => Array
(
[id] => 22
[title] => Fruit
[slug] => fruit
)
)
)
)
How can I get the id from this object? I have tried both of these...
{{$categories->id}}
{{$categories->category->id}}
But they are not working, how should I be extracting this value?