I am creating simple web application in Laravel 4. I have backend for managing applications content. As a part of backend i want to have UI to manage applications settings. I wa
You'll have to extend the Fileloader, but it's very simple:
class FileLoader extends \Illuminate\Config\FileLoader
{
public function save($items, $environment, $group, $namespace = null)
{
$path = $this->getPath($namespace);
if (is_null($path))
{
return;
}
$file = (!$environment || ($environment == 'production'))
? "{$path}/{$group}.php"
: "{$path}/{$environment}/{$group}.php";
$this->files->put($file, '
Usage:
$l = new FileLoader(
new Illuminate\Filesystem\Filesystem(),
base_path().'/config'
);
$conf = ['mykey' => 'thevalue'];
$l->save($conf, '', 'customconfig');