Giter VIP home page Giter VIP logo

Comments (5)

anlutro avatar anlutro commented on August 10, 2024

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.

C0deS1ayer avatar C0deS1ayer commented on August 10, 2024

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:
screen shot 2016-04-10 at 1 29 43 pm

Change the input in the view:
screen shot 2016-04-10 at 1 24 37 pm

Hit Update:
screen shot 2016-04-10 at 1 28 56 pm

You can see that the url on top still has the #fff in the top.

from laravel-settings.

C0deS1ayer avatar C0deS1ayer commented on August 10, 2024

I was able to see my error but am getting this in when clicking update. I wasn't receiving the request before.

screen shot 2016-04-10 at 2 40 22 pm

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.

ConquestMedia avatar ConquestMedia commented on August 10, 2024

@C0deS1ayer were you able to fix it? I would love to know this, I am falling in something very similar

thanks

from laravel-settings.

anlutro avatar anlutro commented on August 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.