Download the PHP package hatchyu/laravel-settings without Composer

On this page you can find all versions of the php package hatchyu/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 Hierarchical Multi-Scope Settings

A powerful, enterprise-ready Laravel package for managing application-level and user-level settings with hierarchical scope inheritance, caching, and automatic value casting.

Features

Installation

You can install the package via composer:

Run Migrations

The package requires two tables: setting_definitions and setting_values.

Configuration

The package automatically registers its Service Provider. If you need to manually register it, add this to config/app.php:

Basic Usage

Global Settings

Use the settings() helper or the Settings facade:

Nested Retrieval

If you have multiple settings under a prefix, you can retrieve them as an array:


Scoped Settings

The real power of this package lies in its ability to handle different scopes (User, Team, Project, etc.).

1. Prepare your Model

Implement the SettingsScope contract and use the HasSettings trait in your model:

2. Using Scoped Settings


Technical Details

Setting Definitions

Settings are stored in two parts:

  1. Definitions: Defines the key, data type, and default value.
  2. Values: Stores the actual value for a specific scope.

When you use set(), the package automatically creates a definition if it doesn't exist, inferring the data type.

Supported Data Types

The package automatically casts values based on the definition's data_type:

Caching

Settings are cached for 60 minutes (3600 seconds) by default. The cache is automatically cleared for a specific key when that key is updated via set() or removed via forget().


API Reference

SettingsManager / settings() helper

Method Description
scope(SettingsScope $scope) Returns a new manager instance focused on the given scope.
get(string $key, $default = null) Retrieve a setting value.
set(string $key, $value) Store a setting value for the current scope.
has(string $key) Check if a setting exists in the current scope chain.
forget(string $key) Remove a setting value for the current scope.
all(?string $prefix = null) Retrieve all settings (optionally filtered by prefix).

License

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


All versions of laravel-settings with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework Version ^10.0||^11.0||^12.0||^13.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 hatchyu/laravel-settings contains the following files

Loading the files please wait ...