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

frankhosaka's avatar

class "Chirp" not found

I can see dd(Chirp::all()) on ChirpController, but i get a error when i try use php artisan tinker > Chirp::all( );

0 likes
7 replies
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

This error occurs when the Chirp class is not properly autoloaded in the tinker environment. To fix this, try running the following command in your terminal:

composer dump-autoload

This will regenerate the autoload files and should allow tinker to find the Chirp class. If that doesn't work, make sure that the Chirp class is properly namespaced and located in the correct directory.

If you're still having issues, try manually including the Chirp class in tinker by running the following command:

require_once app_path('Chirp.php');

This should allow you to use the Chirp class in tinker.

11 likes
siangboon's avatar

you may need to include the full path of the class or set the namespace...

frankhosaka's avatar

Thanks a lot Lary, the "composer dump-autoload" solved my trouble.

1 like

Please or to participate in this conversation.