Skip to content

ctsoft-de/laravel-database-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Database Settings

This package allows you to save settings in the database. Multi-Tenancy is supported out of the box.

Installation

composer require ctsoft/laravel-database-settings

Usage

The usage is the same as config in the Laravel framework.

// Facade
Settings::set('foo', 'bar');
Settings::set(['foo' => 'bar', 'myarr.key1' => true, 'myarr.key2' => 5.87]);
Settings::get('foo');
Settings::get('myarr.key1');

// Helper
setting(['foo' => 'bar']);
setting('foo');

Publish configuration

If you want to change the configuration of the package publish the configuration file and see the next sections.

php artisan vendor:publish --provider="CTSoft\Laravel\DatabaseSettings\Providers\DatabaseSettingsProvider" --tag=config

Default values

In the package configuration file you can define default values which should be used if a setting does not exist.

[
    'foo'   => 'myval',
    'myarr' => [
        'key1' => false,
    ],
]

Encryption

In the package configuration file you can define which settings should be encrypted in the database.

[
    'bar',
    'myarr' => [
        'key2',
    ],
]

Multi-Tenancy

This package supports the following multi-tenancy packages:

  • Stancl Multi Database
  • Stancl Single Database

To use tenancy support you must define it in the package configuration file. If you use any other multi-tenancy package please study the source code of this package. It is easy to add your own tenancy support.

Publish database migrations

If you want to adjust the database table publish the migration files.

php artisan vendor:publish --provider="CTSoft\Laravel\DatabaseSettings\Providers\DatabaseSettingsProvider" --tag=migrations

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

Laravel Database Settings is open-sourced software licensed under the MIT license.

About

Database settings for Laravel with tenancy support.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages