Skip to content
Laravel Packagev13.xMIT License473+ downloads

Settings: Settings that keep their type

Settings stores application settings for the whole application, a named scope, or any Eloquent model, through a real Setting model. Every setting keeps its type, reads fall back from branch to company to global only when you ask, and the cache is forgotten only after your transaction commits.

$composer require pharaonic/laravel-settings

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.0 Nov 10, 20268.3 – 8.513Current Docs: Read the v13.x docs
v12.xv12.0.0 Nov 10, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.0 Nov 10, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.0 Nov 10, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.0 Nov 10, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.0 Nov 10, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.0 Nov 10, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.0 Nov 10, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.0
Nov 10, 2026 (3 weeks ago)
Released lines
8
documented lines with a release; see compatibility
CI on develop
Tests passed
latest run Nov 10, 2026

From the package's releases and its GitHub Actions. A passing run means the test suite passed on develop, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

Store typed values per scope and read them with an explicit fallback chain.

app/Http/Controllers/BranchController.php
1settings()->setValue('theme', 'light'); // global
2$company->setSetting('theme', 'dark'); // company scope, saved right away
3settings('checkout')->setValue('minimum', 100); // stays an integer
4 
5$theme = settings($branch)
6 ->fallbackTo($company)
7 ->fallbackToGlobal()
8 ->getValue('theme', 'system'); // "dark"
9 
10settings($branch)->fallbackTo($company)->explainValue('theme');
11// ['found' => true, 'source' => 'company:12', 'inherited' => true, ...]
Key Features

Everything you need for typed, scoped settings

Add one trait to a model, or call settings(), and start storing values.

Typed Values

Each setting stores its type and nullability; "20" never sneaks into an integer setting.

Global, Named and Model Scopes

settings(), settings('checkout') and settings($company) share one table, kept unique by the database.

Explicit Fallback

fallbackTo() reads branch, then company, then global; a stored null stops the chain.

Plain Eloquent

Setting::for($company)->where(...)->get() returns Setting models, as Eloquent always does.

Definitions and Validation

Declare the type, default and Laravel rules of important keys once, for every scope.

Transaction-Safe Cache

Each scope is cached on its own and forgotten only after the outermost transaction commits.

Related Guides

Practical guides that use Laravel Settings, or solve the problem it was built for.

FAQ

Settings Questions

Quick answers about installing and using Settings.

What is Settings?

Typed settings for the whole application, any named scope, or any Eloquent model, stored through a real Setting model with explicit fallback, definitions and validation. It's a free, open-source Laravel package by Pharaonic.

How do I install Settings?

Run composer require pharaonic/laravel-settings in your project's root directory, then php artisan migrate.

What does Settings require?

The latest release requires PHP 8.3 – 8.5 and Laravel 13.

How is it different from Laravel Dynamic Config?

Settings stores application preferences that your code reads with getValue(). Laravel Dynamic Config stores values that it merges into Laravel's own config(). They use separate tables and never touch each other, so you can use both.

Does a model scope follow my morph map?

Yes. A model's scope is its morph class and key, such as company:12, so settings($company) and settings('company:12') are the same rows.

How do I upgrade from version 1.x?

Run php artisan settings:migrate-legacy for a report, then again with --apply. It converts the old table side by side and keeps a backup.

Is Settings free to use?

Yes. Settings is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Settings documentation?

Read the Settings documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Settings?

Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.

Ready to dig in?

Read the full documentation for installation, scopes, typed values and casting, definitions and validation, fallback, caching, and upgrading from 1.x.