Download the PHP package leeovery/laravel-settings without Composer

On this page you can find all versions of the php package leeovery/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 Build Status Quality Score Total Downloads

This package allows you to create one or many setting files which store default settings, but also expose an API to edit the settings, and store those edits in the DB. When the settings are fetched the custom values are merged into the defaults.

Most useful for user-based settings, but can be used for a multitude of other reasons.

Best to give a quick example...

Installation

You can install the package via composer:

Usage

Given a settings file called /config/settings-user-notifications.php and with the following contents...

You can do this to fetch the settings:

As you can see, this will return all the above settings for user with the ID of 100.

Note that those settings won't be different from the defaults as at this point the user has not made any changes.

Lets change that now...

The line above calls set() and passes the key and value. That value is persisted in the DB for that user. So that we can do the following...

Returned data now equals all the default values EXCEPT for the nested key orders.general.email where that will equal FALSE, as per the custom change above.

That's the most basic use-case...

But, you can do more...

Multiple Setting Files

You can setup multiple setting files in the config directory, just prepend the filename with settings- (or whatever you configure in the package config file.

Eg:

/config/settings-user-privacy.php /config/settings-social.php /config/settings-user-account-access.php

Now you can get() and set() the settings from those files...

Value Object Based Values

You can use objects as the values in the settings file, like this:

Access Subsets Rather Than All Settings

Sometimes you only need a subset of settings. You can do that by specifiying the key with dot notation. Note the package will still fully key the results so that you can use the keys for setting.

Eg:

Given a setting file /config/settings-email-notifications.php:

You can store a user edit like this:

And... you can access the deep status_change subset like follows:

As you can see we fully key the results but only return the requested subset.

TODO

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of laravel-settings with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1
illuminate/config Version ^8.0|^9.0
illuminate/database Version ^8.0|^9.0
illuminate/support Version ^8.0|^9.0
spatie/laravel-package-tools Version ^1.4.3
myclabs/deep-copy Version ^1.9
ext-json Version *
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 leeovery/laravel-settings contains the following files

Loading the files please wait ....