Category: Database

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.

Related Articles