New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

roundly-consulting/options-for-laravel

Manage global or per-entity options and preferences with typed casts and in-request caching.
1,002 5

Larablocks Analysis

roundly-consulting/options-for-laravel works with Laravel 13 (latest release 2.0.0, Nov 7, 2026).

Laravel 12 in earlier releases.

Recommendation checks

Use with care

Use with care: meets 2 of 5 checks.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Nov 7, 2026)
  • First released under 90 days ago
  • 851 downloads a month (needs 10,000)
  • 5 GitHub stars (needs 100)

State

Too new to judge
  • Last stable release: Nov 7, 2026.
  • 5 releases in the last 12 months.
  • First released: Oct 3, 2026.
  • Monthly downloads: 851.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require roundly-consulting/options-for-laravel
Latest Version:2.0.0
PHP:^8.4
Laravel:13
Older releases:12
License:MIT
Last Updated:Nov 7, 2026
Links: GitHub  ·  Packagist
Maintainer: mihaliak

Options for Laravel — Roundly open source

Latest release Tests Code style Donate Patreon Crypto

Options for Laravel

Global or per-model options, settings and preferences for Laravel. Each option is a small class with its key, default value, cast and validation rules; values can belong to the whole app or to any Eloquent model (a user, a team, a tenant) and are cached, typed and evented.

Installation

Requires PHP 8.4 and Laravel 13.

composer require roundly-consulting/options-for-laravel
php artisan vendor:publish --tag="options-migrations"
php artisan migrate

If your owner models have UUID/ULID keys, set OPTIONS_KEY_TYPE before migrating.

Usage

Describe an option once (php artisan make:option ThemeOption --key=theme scaffolds it):

use RoundlyConsulting\Options\BaseOption;

final class ThemeOption extends BaseOption
{
    public function key(): string
    {
        return 'theme';
    }

    public function default(): mixed
    {
        return 'light';
    }

    public function rules(): array|string
    {
        return ['required', 'in:light,dark'];
    }
}

Then read and write it — globally or for any model:

use RoundlyConsulting\Options\Facades\Options;

Options::get(ThemeOption::class);                 // 'light' — the default until a value is stored
Options::set(ThemeOption::class, 'dark');         // validated against rules(), cached, fires OptionSet

Options::set(ThemeOption::class, 'light', $user); // scoped to one model
Options::for($user)->get(ThemeOption::class);     // 'light'
Options::forget(ThemeOption::class, $user);       // back to the default

Documentation

The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/options-for-laravel

Release notes are in CHANGELOG.md. To contribute, see the contributing guide.

Support our work

This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.

Donate to Roundly open source Become a patron on Patreon Donate crypto: BTC, ETH, BNB or SOL

License

The MIT License (MIT). See LICENSE for details.

Alternatives to roundly-consulting/options-for-laravel

sitesource/laravel-polymorphic-settings

Polymorphic, per-model key-value settings for Laravel with opt-in encryption and...

6,095 0
konekt/gears

Settings and User Preferences library for Laravel

82,368 5
hosmelq/laravel-model-preferences

Per-model preferences for Laravel with defaults and validation.

10,494 1
spits-online/laravel-options

Cached database options for Laravel

1,024 0
nyoncode/wire-module-settings

Application settings for wire: typed key/value settings with a page to edit them...

1,065 0

Version History

Version Released PHP Laravel License
2.0.0 ^8.4 ^13.0 MIT
1.1.2 ^8.4 ^12.0|^13.0 MIT
1.1.1 ^8.4 ^12.0|^13.0 MIT
1.1.0 ^8.4 ^12.0|^13.0 MIT
1.0.0 ^8.4 ^12.0|^13.0 MIT