Download the PHP package shopapps/laravel-settings without Composer

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

Store and retrieve application settings from the database with built-in caching and an optional FilamentPHP admin panel.

Settings work like Laravel's config() helper — use dot-notation keys, store any type (strings, booleans, arrays, JSON), and scope settings globally or per-user. A pre-cache system loads all settings into memory in a single read for near-zero latency.

Requirements

Installation

Publish and run the migration:

Optionally publish the config file:

This creates config/laravel-settings.php where you can customise caching, access control, and table options.


Quick Start


Usage

Reading Settings — setting()

Dot-notation keys are fully supported. If you store an array under the key notifications, you can access nested values:

Writing Settings — setting_add()

The type is auto-detected when omitted, but you can be explicit: string, boolean, integer, float, array, object.

Deleting Settings — setting_delete()

Clearing Cache — setting_clear_cache()

Service Class

All helpers delegate to SettingService. You can use it directly:

Deprecated Aliases

These function names still work but will be removed in a future major version:

Deprecated Use Instead
add_setting() setting_add()
delete_setting() setting_delete()
clear_settings() setting_clear_cache()

Caching

Laravel Settings has two caching layers that work together:

Per-Key Cache (enabled by default)

Each setting is individually cached on first read. Fast for small numbers of settings, but each key is a separate cache call.

Pre-Cache (recommended for production)

All database settings are loaded into a single cache entry and held in memory for the remainder of the request. This is similar to how php artisan config:cache works — one read, then pure PHP array lookups.

How It Works

  1. On the first setting() call, the blob is loaded from the cache store into a static property (one I/O operation).
  2. All subsequent calls read from the in-memory array — no cache or database calls.
  3. The blob is authoritative: if a key isn't found in the blob, the default is returned immediately without falling through to the database.
  4. When you setting_add() or setting_delete(), the blob is updated in-place and persisted — no full rebuild needed.

Performance

Scenario Typical Latency
No cache (direct DB query) 15–30 ms
Per-key cache hit 1–5 ms
Pre-cache — first call (loads blob) < 0.01 ms
Pre-cache — subsequent calls (in-memory) < 0.005 ms

Artisan Commands

Build or clear the pre-cache from the command line:

Add php artisan settings:cache to your deployment script alongside config:cache and route:cache:


Filament Admin Panel

The package ships with a FilamentPHP resource for managing settings through the admin panel.

Setup

Register the plugin in your panel provider:

Settings Table

The resource displays all settings in a searchable, filterable table with columns for key, value, type, and user scope.

Cache Management Actions

A ⋮ Cache dropdown in the page header provides four actions:

Action Description
View Cache Opens a read-only modal showing all pre-cached key/value pairs
Build Cache Loads all DB settings into the pre-cache blob
Clear Pre-Cache Removes the pre-cache blob only; per-key caches remain
Clear All Cache Removes everything — pre-cache blob and all per-key caches

Test Setting Action

Each row in the settings table has a ▶ Test button that reads the setting via the setting() helper and displays:

This is useful for verifying that caching is working and diagnosing performance.


Configuration

All options can be set via environment variables or in config/laravel-settings.php:

Caching

Key Env Variable Default Description
cache_settings LARAVEL_SETTINGS_CACHE true Enable per-key caching
cache_ttl LARAVEL_SETTINGS_CACHE_TTL 86400 Per-key cache TTL (seconds)
pre_cache_settings LARAVEL_SETTINGS_PRE_CACHE true Enable pre-cache blob
pre_cache_ttl LARAVEL_SETTINGS_PRE_CACHE_TTL 86400 Pre-cache blob TTL (seconds)

Access Control

Restrict who can access the Filament resource:

Display

Key Env Variable Default Description
edit_mode LARAVEL_SETTINGS_EDIT_MODE text Array editing mode: text (textarea) or simple (key-value fields)
scope_to_tenant — true Scope settings to the current Filament tenant
navigation_section_group — Settings Navigation group label

Contributing

Feel free to submit pull requests or create issues for bug fixes and new features.

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-settings with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4|^8.5
filament/filament Version ^5.0|^6.0
illuminate/support Version ^11.28|^12.0|^13.0
spatie/laravel-package-tools Version ^1.0|^2.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 shopapps/laravel-settings contains the following files

Loading the files please wait ...