Download the PHP package justijndepover/laravel-settings without Composer

On this page you can find all versions of the php package justijndepover/laravel-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-settings

Laravel Settings

Latest Version on Packagist Total Downloads

Store settings in your Laravel application.

Installation

You can install the package with composer

After installation you can optionally publish your configuration file

configuration

This is the config file

If you chose the default database driver, you should publish the migration file and execute it

Usage

You have three different ways of interacting with the settings.

Use the global helper function

Inject the settings class with dependency injection

Use the global facade

all functionality is available with each method.

Examples

User settings

In addition to default settings, you can also use this package to store user settings. Add the HasSettings trait to your User model

After installing the trait, you get a settings method on your user

Language specific settings

It's possible to store / access settings for specific locales.

Note on how this works

Caching

Whenever a read operation is executed, the package will check if the value is present in the cache. If it's not found, a read operation will be performed to the database (all values are fetched) and stored in the cache for other calls to consume.

This means that performing multiple reads (even with multiple keys) will only perform one database call.

If a write operation is performed, the cache is cleared. Resulting in a new read from database when a new settings is queried.

IMPORTANT This means the package uses the cache as it's main source, and falls back to the database otherwise. (which is good in most cases) If you change database values directly, you should clear the cache manually.

When working with serverless applications (e.g. AWS Lambda + Bref or Laravel Vapor), this could cause problems if you don't share the cache between the Lambda functions. In this case you should either set your Laravel cache to something like Redis, or disable the cache feature in this package. To do this, publish the configuration file and set the cache_time to 0.

Clearing the cache

It's also possible to clear the cache programmatically:

User and locale settings

The default driver always stores a locale and user_id field in the database (defaults to null). Fetching data from the database will also query on these parameters.

To query something different than null, you should chain the forUser or forLocale between the setting and final method.

Security

If you find any security related issues, please open an issue or contact me directly at [email protected].

Contribution

If you wish to make any changes or improvements to the package, feel free to make a pull request.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-settings with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package justijndepover/laravel-settings contains the following files

Loading the files please wait ....