Refactored app.blade.php to use class_exists instead of View::exists for checking if a class exists and config values for enabling/disabling certain components. #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactors the
app.blade.php
file to improve the way we check for the existence of classes and manage component visibility based on configuration values.Motivation for Changes
The previous implementation relied on
View::exists
to determine if certain components should be included. However, this approach is less efficient and less clear than directly checking if a class exists usingclass_exists
. By usingclass_exists
, we ensure that we are only attempting to include components that are actually available in the application, which can prevent potential errors and improve performance.Additionally, the refactor standardizes the configuration keys used to enable or disable components, aligning them under the
layouts-wrapper
configuration namespace. This enhances the organization of configuration settings and makes it easier for developers to manage component visibility.Improvements to the Project
Overall, this refactor enhances the robustness of our layout file and improves maintainability, ultimately contributing to a more reliable application.