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

Maheeb's avatar

I can not execute php artisan command on terminal

Hi , I am a newbie in laravel . Today , I tried to execute the command "Php artisan make:controller --resource AdminUsersController" in my php storm terminal ..From then it kept showing that--- "[ErrorException] Use of undefined constant AdminUsersController - assumed 'AdminUsersController' (this will throw an Error in a future version o f PHP)

" And the disgusting thing is if i try to execute another command like --- "php artisan route:list"

It keeps giving the above error message on terminal . I dont know how to fix this ..Please , please help me . Thanks in advance.

0 likes
1 reply
Snapey's avatar

You have added something to your code which it does not like. The artisan commands all bootstrap your application so if you have an error in somewhere critical it can block artisan.

The thing to do is to look in the laravel log file (storage/logs) for the last error and see what file its referring to.

Please or to participate in this conversation.