Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Create a config to override filesystem #30

Merged
merged 4 commits into from
Aug 18, 2024

Conversation

tanhongit
Copy link
Member

Summary

Unit Testing

Operation check

Caution

Release Notes

Note

Additional Notes

Checklist

  • Code follows our Coding Standards.
  • Code matches the confirmed solution in the ticket.
  • Unit/Integration tests have been added or updated.
  • Env/Config/DB changes were confirmed by @cslant/admin.

@tanhongit tanhongit self-assigned this Aug 18, 2024
@tanhongit tanhongit added enhancement New feature or request feature request Want to create a new feature, improvement, or change in the existing system or project labels Aug 18, 2024
@tanhongit tanhongit added this to the Resource config milestone Aug 18, 2024
$configName = pathinfo($file, PATHINFO_FILENAME);
$configPath = $configDir.'/'.$file;

if (file_exists(config_path($configName.'.php'))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated code adds a check to see if the configuration file exists before merging. If it does, the new configuration is merged with the existing one using config()->set and array_merge. If the file doesn’t exist, it falls back to the original method of merging with mergeConfigFrom. This change enhances flexibility in handling configuration files.

@tanhongit tanhongit merged commit 2d2ec4e into main Aug 18, 2024
14 of 15 checks passed
@tanhongit tanhongit deleted the feature/Create-a-config-to-override-filesystem-#6 branch August 18, 2024 05:46
@tanhongit tanhongit linked an issue Aug 18, 2024 that may be closed by this pull request
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request feature request Want to create a new feature, improvement, or change in the existing system or project
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Create a config to override filesystem configs of Laravel
1 participant