Giter VIP home page Giter VIP logo

Comments (3)

bweston92 avatar bweston92 commented on August 10, 2024

I think you should take a look at Laravel's facade documentation. I'm in phone so no time to explain.


Sent from Mailbox

On Sat, Nov 7, 2015 at 9:03 PM, Ecomus Ltd [email protected]
wrote:

When I try and call statically I get the error:

Non-static method anlutro\LaravelSettings\SettingStore::set() should not be called statically, assuming $this from incompatible context

This is what I'm trying:

use anlutro\LaravelSettings\DatabaseSettingStore as Setting;
      Setting::set('foo', 'bar');
      Setting::get('foo', 'default value');
      Setting::save();

I can get this working but only by using the following:

use anlutro\LaravelSettings\DatabaseSettingStore as Setting;
      $conn = DB::connection('database_connection');
      $store = new Setting($conn,'settings');
      $store->set('foo', 'bar');
      $store->set('nest.one', 'nestone');
      $store->set('nest.two', 'nesttwo');
      $store->set('array', array('one', 'two'));
      $store->save();

I'm a newbee to laravel so any help is really grateful

Reply to this email directly or view it on GitHub:
#37

from laravel-settings.

anlutro avatar anlutro commented on August 10, 2024

Follow the instructions here: https://github.com/anlutro/laravel-settings#installation Step 2 and 4 in particular.

You're supposed to call the facade class, not the store class itself.

from laravel-settings.

ecomus avatar ecomus commented on August 10, 2024

ah ha, cool thank you for the information on the facade, I hadn't read that before.

I was looking in the database table but hadn't set it up in the settings.php file. Working now thank you both.

Live and learn

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.