Support the ongoing development of Laravel.io →
Configuration Database Architecture
Last updated 2 years ago.
0

You can do this by placing your custom config file in config directory.

  • config/custom.php

    <?php return [ 'test' => [ 'url' => 'this is a test url' ] ];

you can access this by 'config' helper function

$url = config('custom.test.url')

this will return " this is a test ur l"

Last updated 8 years ago.
0

Thanks @mrabbani that helped me so far to store those data. Perfect.

BUT: How can i write them into that config? :) Or do i really have to put them into the DB?

0

I just found: http://tutsnare.com/how-to-create-custom-configuration-in-laravel/ The set() and the get() on Config.

But the data (for example test.url) is not saved to the config/custom.php

0

No, custom configuration created by Config::set() is not stored to your config files. You really should be using a database table to store that.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

phoenixh phoenixh Joined 30 Nov 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.