Skip to content
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

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

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

thejmitchener
Copy link
Member

@thejmitchener thejmitchener commented Nov 13, 2024

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 using class_exists. By using class_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

  1. Performance: By directly checking for class existence, we reduce unnecessary overhead and improve the efficiency of the view rendering process.
  2. Clarity: The new checks make it clearer what components are being conditionally included based on their availability, improving code readability.
  3. Consistency: Standardizing the configuration keys ensures that all related settings are grouped together, making it easier to understand and modify component behavior.

Overall, this refactor enhances the robustness of our layout file and improves maintainability, ultimately contributing to a more reliable application.

…for checking if a class exists and config values for enabling/disabling certain components.
@thejmitchener thejmitchener enabled auto-merge (squash) November 13, 2024 20:35
@thejmitchener thejmitchener merged commit 729604d into main Nov 13, 2024
7 checks passed
@thejmitchener thejmitchener deleted the update-if-directives branch November 13, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant