hackeresq / laravel-settings Goto Github PK
View Code? Open in Web Editor NEWSuper simple key/value settings for Laravel 5+ that comes with encryption and multi-tenancy out of the box
License: MIT License
Super simple key/value settings for Laravel 5+ that comes with encryption and multi-tenancy out of the box
License: MIT License
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
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`))
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.
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'),
Because of the use of the union datatype, this package only works on PHP 8 and up.
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
Hi,
Thanks for this great package.
I got the error below when using this package with my project using Laravel 5.8:
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:
However, it's super manual, and I'd like to know better way to solve it.
Thanks.
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!
We already had a data table with the name "settings." Could you have patch to customize the name of the data table?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.