Curated articles, resources, tips and trends from the DevOps World.
Summary: This is a summary of an article originally published by the source. Read the full original article here →
by This time, I wanted to share my solution to loading custom settings from a JSON file into Laravel’s config.
But if you have a lot more logic happening in your service provider you can create a new one just for this purpose.
Now, let’s see how to edit or write to this file when you need to make new changes to the config.
Let’s say you just need to edit one property; you can do this by updating your config like so config(['settings.name' => 'New Value']), and you could json_encode(config('settings')) and save the results to the file system.
Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com