Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How to add and update config varaibles in laravel

$
0
0

I have a config variable file which I'm using it in my controllers instead of mysql for faster performance.

But my problem is that I can only read from this config file and I can not add or update any value from it.

any suggestion how to update or add new values to this variable file :

my variable file which is stored in /config/Banners_size.php:

return ["normal_x970h90" => ['status' => 'enable','value' => '500'    ],"normal_x234h60" => ['status' => 'enable','value' => '500'    ],]

my php code to add new array to it which is not working :

    $banners = Config('Banners_size');    $banner = array(        $request->input('size') => ['status' => $request->input('status'),'value' => $request->input('cost')        ]    );   $bannerinfo = array_merge($banners, $banner);   Config('Banners_size' , $bannerinfo);

Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>