Download the PHP package owowagency/laravel-settings without Composer

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

Total Downloads Latest Stable Version

A package of settings features for the Laravel framework.

Installation

Installing this package can be done easily via the following Artisan command.

Setup

To install all the vendor files you can run the following command.

This will copy all the vendor files, including configuration, migrations and resources. If you wish to only install certain files you can use the command described in the next paragraphs.

Config

If you wish to publish the configuration file, you can use the following command:

Settings

The settings configuration holds all the values which can be used within the application. Each setting should have a unique key. For setting the key we would recommend using a package like Laravel Enum. Beside the key, we use the following attributes:

Table

The table_name configuration holds the value which is being used for the table name. By default, this has been set to settings, but if you wish to use a different table name you can change it with this configuration value.

Resources

The package uses Laravel its API Resources. We ship the package with one resource, which will return the setting model. If you wish to use a custom resource, you can specify them in this list.

Migrations

If you wish to publish the migrations, you can use the following command:

Routes

To set up all the routes needed for this package you can call the setting macro on the Route facade. By doing so, all the routes which are required by this package will be available to call.

After adding this to one of your routes files (i.e. routes/api.php), the following two routes will be available.

Index

This route can be used to index all the settings of a user: GET /users/{user}/settings. This route will always return all configured settings in the settings config value. Also, values which are not yet stored for the authenticated user. The package will then use the default configured value.

Response

Update

This route can be used to update the given setting values: PATCH /users/{user}/settings.

Request

Response

Usage

If you want a certain model (we'll use the user model in this example) to have settings you can add the OwowAgency\LaravelSettings\Models\Concerns\HasSettings trait to the model. First you should add the OwowAgency\LaravelSettings\Models\Concerns\HasSettingsInterface to the model. Your model could look like this.

Now, to get a certain config value from the user you can do this:


All versions of laravel-settings with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.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 owowagency/laravel-settings contains the following files

Loading the files please wait ....