grazulex / lardefset
Default settings for Laravel projects.
v0.1.0
2026-11-09 04:25 UTC
Requires
- php: ^8.4
- laravel/framework: ^12.8.1|^13.0
Requires (Dev)
- laravel/pint: ^1.32
- orchestra/testbench: ^10.2|^11.0
- pestphp/pest: ^3.8.1|^4.7|^5.3
- pestphp/pest-plugin-type-coverage: ^3.6|^4.0
- phpstan/phpstan: ^2.3
- rector/rector: ^2.8
- symfony/var-dumper: ^7.4|^8.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-09 04:28:32 UTC
README
Sensible default settings for Laravel applications, applied automatically when the package is installed.
Requires PHP 8.4+ and Laravel 12.8+ or 13
Installation
composer require grazulex/lardefset
The service provider is auto-discovered. Every default listed below is applied on boot; nothing else is needed.
Defaults
| Configurable | What it does | Default |
|---|---|---|
AggressivePrefetching |
Vite::useAggressivePrefetching() — prefetches all Vite assets after page load. |
enabled |
AutomaticallyEagerLoadRelationships |
Model::automaticallyEagerLoadRelationships() — eager loads relationships on demand to avoid N+1 queries. |
enabled |
FakeSleep |
Sleep::fake() — Sleep calls return immediately. Only when running unit tests. |
enabled |
ForceScheme |
URL::forceHttps() — every generated URL uses https. |
enabled |
ImmutableDates |
Date::use(CarbonImmutable::class) — now(), model dates, etc. return immutable instances. |
enabled |
PreventStrayRequests |
Http::preventStrayRequests() — HTTP client calls without a fake throw. Only when running unit tests. |
enabled |
ProhibitDestructiveCommands |
DB::prohibitDestructiveCommands() — blocks migrate:fresh, db:wipe, etc. in production. |
enabled |
SetDefaultPassword |
Password::defaults() — in production: min 12, max 255 characters, not found in known data leaks. |
enabled |
ShouldBeStrict |
Model::shouldBeStrict() — prevents lazy loading, silently discarded attributes and access to missing attributes. |
enabled |
Unguard |
Model::unguard() — disables mass-assignment protection. |
disabled |
All classes live in the Grazulex\Lardefset\Configurables namespace.
Configuration
Each default can be turned on or off from a config/lardefset.php file, keyed by the configurable's class name:
<?php use Grazulex\Lardefset\Configurables; return [ // Keep plain http URLs on local environments. Configurables\ForceScheme::class => env('APP_ENV') !== 'local', // Opt in to unguarded models. Configurables\Unguard::class => true, ];
A configurable missing from the file keeps its default.
Development
composer lint # Pint composer refacto # Rector composer test:types # PHPStan composer test:unit # Pest (100% coverage required) composer test # everything above, in check mode
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
License
The MIT License (MIT). See LICENSE.md.