New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage of facade aliases causes exceptions when aliases are forbidden in project. #2723
Comments
Hi @swayok Facades, such as If you unintentionally removed these facades and are experiencing their absence, it is recommended to check your project's configuration file to ensure it aligns with the framework's recommendations. You can review the configuration file at this link: link to configuration file. It is recommended to keep the facades enabled. However, if you deliberately removed the facade registration in accordance with your organization's policies or personal preferences, you can dynamically register the facades, for example, within a middleware, to make them work only in your Orchid application. The current use of facades does not pose any problems for me or for the majority of users. However, abandoning the use of facades would impose limitations on my role as a maintainer. Are there any significant reasons to refrain from using facades in this package? This will help me better understand the context and make an informed decision. |
HI. I did not mean to remove usage of facedes. The problem is usage of aliases of facades that Laravel declares in I've forked a platform and managed to run it without facade aliases - all you need to change is replace Also I've seen a problem with arguments typization. For example: you have |
Describe the bug
In blade templates you use aliases of facades like
{{ Auth::check() }}
that cause exceptions likeClass "Auth" not found
when project discourages usage of aliases.To Reproduce
Steps to reproduce the behavior:
config/app.php
remove everything fromaliases
:'aliases' => []
/admin
Class "Auth" not found
Expected behavior
No exception.
Additional context
In most cases aliases can be replaced by
app(class)
or fully qualified name of the facade. This way platform will be more independent from the project's configs and restrictions.The text was updated successfully, but these errors were encountered: