Comments (5)
You might need to call Settings::save()
in your update
method, since people have reported the middleware etc. not working in Laravel 5.
from laravel-settings.
Do you think since I'm doing it edit on index it might not be passing the information to the update? Is there something to do with edit that will allow it? I added the Save:setttings and got a 500. The next step I did was trying to var_dump out the settings request. See screen shots. I really appreciate your help.
Loads with the correct information in the view:
You can see that the url on top still has the #fff in the top.
from laravel-settings.
I was able to see my error but am getting this in when clicking update. I wasn't receiving the request before.
Current Update is
` public function update(Request $request)
{
$background_color = $request->input('background_color');
Settings::set('background_color', $background_color);
return redirect('admin');
}`
from laravel-settings.
@C0deS1ayer were you able to fix it? I would love to know this, I am falling in something very similar
thanks
from laravel-settings.
Sorry for not responding here but I really can't take the time to debug basic issues for you. Your error message makes it sound like you've got the facade wrongly set up. This is all you should need in your controllers:
public function edit()
{
return View::make('admin.settings', [
'settings' => Setting::all(),
]);
}
public function update(Request $request)
{
Setting::set($request->only('background_color', 'text_color'));
Setting::save(); // not needed if you use the middleware
return Redirect::route('admin.settings.edit')
->with('message', 'Settings updated!');
}
from laravel-settings.
Related Issues (20)
- Returning an array of settings. HOT 4
- Add support for deferred service provider for Laravel >=5.8
- Does it support Laravel 8? HOT 1
- Dynamic database setting HOT 4
- RTL Support HOT 1
- Laravel 9? HOT 2
- set empty array will throw Exception
- Can anlutro/l4-settings work with MongoDB ? HOT 1
- any idea if this works for Laravel 9.x? HOT 1
- Settings to not save when using DB transactions HOT 2
- Incorrect key is returned in SettingsManager->all() HOT 4
- Hidden keys
- Custom setting store doesn't use cache (or incorrect instructions) HOT 4
- Add support for NULL setting value to DatabaseSettingStore HOT 1
- Support Laravel 10 HOT 1
- bug: multiple `setExtraColumns` calls cause issues with values not being cleared HOT 4
- forgetting or deleting a setting from database is not working HOT 1
- Nested Data
- Usage with Filament Table builder HOT 1
- Creation of dynamic property anlutro\LaravelSettings\SaveMiddleware::$settings is deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-settings.