ali_254 Posted April 15, 2022 Share Posted April 15, 2022 hi . By default, facades is disabled in the Lumen framework.Can it be disabled in Laravel as well? And had direct access to classes? Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 15, 2022 Share Posted April 15, 2022 Facades are aliases defined in the config/app.php. Look in that file for the "aliases" key and you'll find the mappings. With that said, so long as they remain a part of Laravel, if you want to avoid using them (which is a good idea, especially if you want to have sensible unit tests) then just don't use them. There isn't an option to remove them or disable them entirely, and no plan that I know of to do so. They are a convenience option, but you are not forced to, nor required to ever use a facade. 1 Quote Link to comment Share on other sites More sharing options...
ali_254 Posted April 16, 2022 Author Share Posted April 16, 2022 thank you. For direct use of classes (do not use Facades) Should we use "Service Container" ? Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 16, 2022 Share Posted April 16, 2022 Yes, use services you configure. Make sure that you have passed in any related class objects you need to class constructors, including inside controllers. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.