DB::table('categories') should be
DB::table will return a Collection of StdClass objects not a Collection of Category instances.
You are the man Damien! Thank you for saving me some more headache.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.