Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

IsoftTech's avatar

No query results for model [App\Shop\Categories\Category] 1

I just clone laravel app from github and now am facing different kinds of errors. After all the installation and setting I got this error: No query results for model [App\Shop\Categories\Category] 1. This is the my controller:

0 likes
5 replies
bobbybouwmann's avatar

This reason you get this error is because there is no item in the database that matches the query. So you either need to insert the data or build in a check whenever this item is not available.

I expect that there is some table called categories that is connected to this Category model. If you add some categories in there you should be fine. Can you share the code in the controller? Based on that I might be able to give you a better answer!

beetuco's avatar

Use tinker man (especially if DB access is restricted)

php artisan tinker and then App\Shop\Categories\Category::all()

If the collection returns empty you have no rows in the database.

IsoftTech's avatar

This is message I got. => Illuminate\Database\Eloquent\Collection {#2572 all: [], }

Please or to participate in this conversation.