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

michaelnguyen547's avatar

autoload_classmap.php and autoload_static.php in vendor/composer

how does Laravel use these 2 files?

I move some classes around and Laravel still works even though old path of moved classes are still in autoload_classmap and autoload_static.

Do i suppose to run composer dump-autoload when I move classes around in Laravel project?

0 likes
3 replies
D9705996's avatar
D9705996
Best Answer
Level 51

I recommend anytime you modify an existing class's location/namespace to get in the habit of running composer dump-autoload. I have wasted hours of my life debugging random errors when developing to find out it was an auto load issue. It might not always be necessary but quickly becomes muscle memory

https://getcomposer.org/doc/03-cli.md#dump-autoload-dumpautoload-

D9705996's avatar

I believe so unless you use --no-autoloader

Please or to participate in this conversation.