roundly-consulting/options-for-laravel
Options for Laravel gives your app a clean, typed way to store and retrieve configurable settings. Define options once, read them anywhere with simple helpers, and cache values for fast access. Ideal for admin-editable site settings without touching config files.
php artisan vendor:publish) so you can see the model map — this map is the seam a host application uses to swap models.config/your-package.php (or at runtime with config()->set(...)) rather than subclassing internals. Keep swaps to subclasses that preserve the expected contract/interface so the rest of the package keeps working.Model::factory()->create() against a swapped model as your smoke test. If the factory returns an instance of your swapped class, the resolution path is wired correctly end-to-end.config()->set() in setUp()/beforeEach or a dedicated helper to swap the model for a test double, then assert on the class the factory produced (assertInstanceOf). Pair with RefreshDatabase as usual.app(...), resolve(...)) or via the configured key, never new DefaultModel. Hardcoded new calls bypass the swap and reintroduce the exact bug 1.1.2 fixed.newModel()/definition, pull the class from the configured map instead of returning a literal class name, so host swaps propagate into your factory too.factory()->newModel() overrides or Model::unguard-style hacks). 1.1.2 makes this native; leaving workarounds in place can cause double-overrides or confusing test failures.php artisan config:clear (and be aware config:cache bakes the map in), otherwise your swap silently won't apply.app(), resolve()) or the package's resolver. Direct new instantiation will always build the default class, regardless of config.dd(get_class($model)) inside a factory callback, or assert get_class(...) in a test, is the fastest way to confirm which class is actually being built. Also dump the resolved config key (config('your-package.models...')) to verify the cached value.newModel() and delegate to the resolver rather than duplicating class literals.How can I help you explore Laravel packages today?