
How to Build Inherited Model Settings in Laravel Without Fallback Bugs
Design Laravel settings that inherit across companies and branches, distinguish missing values from null, and prevent unsafe tenant overrides.
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.
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.
| Line | Latest release | PHP | Laravel | Status | Docs |
|---|---|---|---|---|---|
| v13.x | v13.0.0 Nov 10, 2026 | 8.3 – 8.5 | 13 | Current | Docs: Read the v13.x docs |
| v12.x | v12.0.0 Nov 10, 2026 | 8.2 – 8.5 | 12 | Maintained | Docs: Read the v12.x docs |
| v11.x | v11.0.0 Nov 10, 2026 | 8.2 – 8.4 | 11 | MaintainedLaravel 11 no longer gets security fixes | Docs: Read the v11.x docs |
| v10.x | v10.0.0 Nov 10, 2026 | 8.1 – 8.3 | 10 | MaintainedLaravel 10 no longer gets security fixes | Docs: Read the v10.x docs |
| v9.x | v9.0.0 Nov 10, 2026 | 8.0 – 8.2 | 9 | MaintainedLaravel 9 no longer gets security fixes | Docs: Read the v9.x docs |
| v8.x | v8.0.0 Nov 10, 2026 | 8.0 – 8.1 | 8 | MaintainedLaravel 8 no longer gets security fixes | Docs: Read the v8.x docs |
| v7.x | v7.0.0 Nov 10, 2026 | 8.0 | 7 | MaintainedLaravel 7 no longer gets security fixes | Docs: Read the v7.x docs |
| v6.x | v6.0.0 Nov 10, 2026 | 8.0 | 6 | MaintainedLaravel 6 no longer gets security fixes | Docs: Read the v6.x docs |
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.
Store typed values per scope and read them with an explicit fallback chain.
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, ...]Add one trait to a model, or call settings(), and start storing values.
Each setting stores its type and nullability; "20" never sneaks into an integer setting.
settings(), settings('checkout') and settings($company) share one table, kept unique by the database.
fallbackTo() reads branch, then company, then global; a stored null stops the chain.
Setting::for($company)->where(...)->get() returns Setting models, as Eloquent always does.
Declare the type, default and Laravel rules of important keys once, for every scope.
Each scope is cached on its own and forgotten only after the outermost transaction commits.
Practical guides that use Laravel Settings, or solve the problem it was built for.

Design Laravel settings that inherit across companies and branches, distinguish missing values from null, and prevent unsafe tenant overrides.
Quick answers about installing and using 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.
Run composer require pharaonic/laravel-settings in your project's root directory, then php artisan migrate.
The latest release requires PHP 8.3 – 8.5 and Laravel 13.
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.
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.
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.
Yes. Settings is open source under the MIT license, so you can use it in personal and commercial projects.
Read the Settings documentation for setup, configuration, and usage examples.
Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.
Read the full documentation for installation, scopes, typed values and casting, definitions and validation, fallback, caching, and upgrading from 1.x.