Download the PHP package ruangdeveloper/laravel-settings without Composer

On this page you can find all versions of the php package ruangdeveloper/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

Introducing "Laravel Settings" – a powerful and flexible Laravel package designed to simplify the management of application settings, both at the global and model-specific levels. With this package, developers can effortlessly store, retrieve, and customize settings within the database, enhancing the configuration and flexibility of Laravel-based projects.

Whether you need to manage site-wide configurations, user preferences, or any other form of customizable settings, "Laravel Settings" provides an elegant solution to streamline the process. It offers a clean and intuitive API, ensuring that you can get started quickly without any steep learning curve.

Key Features:

Requirements

Installation:

To get started with "Laravel Settings," follow these simple installation steps:

Install the package via Composer:

Publish the configuration file:

Configure the settings in config/laravel-settings.php according to your application's requirements.

Publish the migration file

Usage

Let's take a quick look at how you can use "Laravel Settings" to manage a global setting for your application.

Set a global setting

Get a global setting

Get a setting and cast it to a specific type

Available types:

You can also use the following methods to get a setting and cast it to a specific type:

Delete a global setting

Now, if you want to delete the setting

Forget a global setting (deprecated, use delete instead)

Now, if you want to delete the setting

Model Specific Setting

This package allow you to link the setting to a specific model. For example, you may want to store user's preferences.

Model Configuration The first step before linking the setting to a specific model, you need to configure your model to use the HasSettings traits.

Now, you can use the setting for an user.

Set a setting

Get a setting

Get a setting and cast it to a specific type

Available types:

You can also use the following methods to get a setting and cast it to a specific type:

Delete a setting

Forget a setting (deprecated, use delete instead)

Default Settings

You may want add default settings value for global or model specific settings. You can add these settings value in the configuration file located at configs/laravel-settings.php.

Note: if you cannot find the config file, you need to publish the configuration first.

Default global settings

Now, you will always get the default site title setting if there is no setting stored in the database.

Default model specific settings

Now, you will always get the default subscribe newsletter setting when you try to retrieve it from an user that didn't have setting for subscribe newsletter.

Cache

As you know, this package uses a database to store setting values. Every time you retrieve a setting value, it means you are making a query to the database. This is not a problem for small-scale applications, but it can have a significant impact when used in large-scale applications. To work around this, you can enable caching to store setting values in the cache, so the query is only performed once when you first attempt to retrieve a setting value.

To enable caching, you can go to the file config/laravel-settings.php and change the value of with_cache to true. You can also set the prefix and lifetime there.

Customization

Using Your Own Model

While this package covers almost everything that you need to manage the settings, you may want to use your own model. To do this, you can extends the Setting model from this package.

After that, you need to tell this package to use the model you just created. Please update in the configs/laravel-settings.php.

Contributing

https://github.com/ruangdeveloper/laravel-settings/blob/main/CONTRIBUTING.md

License

https://github.com/ruangdeveloper/laravel-settings/blob/main/LICENSE.md


All versions of laravel-settings with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^11.0 || ^12.0
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 ruangdeveloper/laravel-settings contains the following files

Loading the files please wait ....