Code Monkey home page Code Monkey logo

laravel-settings's People

Contributors

blimundo avatar hackeresq avatar markdieselcore avatar ryancwalsh avatar underdpt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-settings's Issues

Getting errror when calling in blade template

ParseError
syntax error, unexpected '|', expecting variable (T_VARIABLE)

How do I call the setting in the balde template? This - {{ Settings::get('logo'); }} - throws above error.

Thanks

tenant migration fails on MySql

I get this error:
SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value (SQL: alter table `settings` add primary key `settings_key_tenant_primary`(`key`, `tenant`))

See https://stackoverflow.com/questions/22971586/mysql-alter-table-causes-error-invalid-use-of-null-value

I think this might fix it; change:

$table->string('tenant')->nullable()->index();
To:
$table->string('tenant')->default('main')->index(); //https://laravel.com/docs/6.x/migrations#column-modifiers

Also, you need to change your down() function.

Schema::dropIfExists('settings'); should only be called in the down() function of the table creation migration.

The down() function of of UpdateSettingsTable should undo specifically what its up() function did.

Also the if (!Schema::hasColumn('settings', 'tenant')) { in up() is unnecessary because nobody should be running this UpdateSettingsTable migration except in cases where they don't have the tenant column yet.

Laravel Config file ?

Hello,
How to be able to call the parameters in the laravel config files:
/config/app.php for example:
'env' => env ('APP_ENV', 'production'),
through
'env' => Settings :: get ('APP_ENV'),

ParseError ?

Hello,
I have the following error:

        
$test = Settings::get();
dd($test);

ParseError
syntax error, unexpected '|', expecting variable (T_VARIABLE)

/vendor/hackeresq/laravel-settings/src/Settings.php

PHP 7.4

error when running "composer install" the first time

Hi,
Thanks for this great package.
I got the error below when using this package with my project using Laravel 5.8:

  • First, I installed this package on my local pc, it's ok (installed, published migration and config files, ran migration).
  • I pushed all changes (composer.json, composer.lock, config/settings.php) to git
  • Next, my staging server pull latest code from git, run "composer install" and got error below:
laradock@54bb41192a0d:/var/www/dev$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
...
...
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In Connection.php line 664:
                                                                               
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tenant' in 'where c  
  lause' (SQL: select `value`, `key` from `settings` where `tenant` = )        
                                                                               

In PDOConnection.php line 66:
                                                                               
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tenant' in 'where c  
  lause'                                                                       
                                                                               

In PDOConnection.php line 64:
                                                                               
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tenant' in 'where c  
  lause'                                                                                                                                                

And, due to that error, I cannot run migration also (got the same issue above)
--> it's something like egg and chicken dilemma, would you please help to review and show me how to solve this problem?

Ps: I did solve it by manually steps below on staging server:

  • remove your package
  • comment all places using "Settings" facade
  • run "composer install" ok again, run "migration" ok
  • then, install again your package, and revert our source back

However, it's super manual, and I'd like to know better way to solve it.

Thanks.

Alias/facade not working

Thanks for sharing your repo. It looks exciting.

I have a question about it.

Even though I'm running Laravel 5.7, your alias/facade doesn't seem to automatically work for me.

Even stranger, when I add this to config/app.php, the alias still doesn't work:

'aliases' => [
    // ...
    'Settings' => hackerESQ\Settings\Facades\Settings::class,
];

What works is adding this to the top of each class where I want to use your Settings: use hackerESQ\Settings\Facades\Settings;

But why would that be necessary?

I'm confused why your instructions wouldn't be working for me on Laravel 5.7 and am hoping you have ideas.

Thanks!

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.