I'm familiar with composer.json as part of the development process. But why is it needed Laravel is running?
We deployed a Laravel app but excluded composer.json as we considered it a "development-only" file, only to find certain pages crashing with a 500 error, and the error log showing a failure to read composer.json
We've just started using Blade components, and upgraded to Laravel 11.
@jlrdw Thanks for the answer. Do you happen to know when Laravel calls getNamespace? I use composer install --classmap-authoritative for production and never met this error. I wonder if that's just lucky, or if --optimize and/or --classmap-authoritative remove the need to check composer.json
@roddyp You’d need to actually read the stack trace of the 500 errors as to what is requiring the presence of composer.json file. But you should be deploying it. It should be in a non-web accessible location so it being on your server or not should be a non-issue.