limenet / laravel-baseline
A highly opinionated Laravel baseline.
Fund package maintenance!
Requires
- php: ^8.3
- ext-simplexml: *
- composer/semver: ^3.4
- illuminate/contracts: ^12.0 || ^13.0
- laravel/prompts: ^0.3 || ^1.0
- nesbot/carbon: ^3.0
- nikic/php-parser: ^5.7
- phpstan/phpstan: ^2.1.40
- rector/rector: ^2.3.8
- spatie/laravel-package-tools: ^1.93
- symfony/finder: ^7.4 || ^8.0
- symfony/yaml: ^7.4 || ^8.0
Requires (Dev)
- larastan/larastan: ^3.9.6
- laravel/framework: ^12.53.0 || ^13.8.0
- laravel/pint: ^1.29.1
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^8.9.4
- orchestra/testbench: ^10.9.0 || ^11.1
- pestphp/pest: ^4.7.0
- pestphp/pest-plugin-arch: ^4.0.2
- pestphp/pest-plugin-laravel: ^4.1
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan-deprecation-rules: ^2.0.4
- phpstan/phpstan-phpunit: ^2.0.16
- spatie/laravel-health: ^1.39.2
- spatie/temporary-directory: ^2.3.1
- symplify/rule-doc-generator-contracts: ^11.2
Conflicts
- laravel/boost: ^1.0
- dev-main
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.25
- 1.2.24
- 1.2.23
- 1.2.22
- 1.2.21
- 1.2.20
- 1.2.19
- 1.2.18
- 1.2.17
- 1.2.16
- 1.2.15
- 1.2.14
- 1.2.13
- 1.2.12
- 1.2.11
- 1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2026-05-17 08:36:33 UTC
README
Checks your Laravel installation against a highly opinionated baseline.
Installation
You can install the package via composer:
composer require limenet/laravel-baseline
You can publish the config file with:
php artisan vendor:publish --tag="laravel-baseline-config"
Usage
Add to your composer.json to run checks (and auto-fix) after every composer update:
"post-update-cmd": [ "@php artisan limenet:laravel-baseline:check --fix" ],
Running checks
# Check only — report issues without making changes php artisan limenet:laravel-baseline:check # Auto-fix — apply all safe automatic fixes, then report remaining issues php artisan limenet:laravel-baseline:check --fix
Checks marked 🔧 below support --fix. When --fix is used:
- Fully fixable checks: all conditions are applied automatically.
- Partially fixable checks (requires package installed first): configuration/script entries are fixed once the package is installed via
composer require. - Non-fixable checks: report the issue with an actionable message.
Checks
This package validates your Laravel installation against the following checks:
Testing & Quality Tools
usesPest()- Validates Pest testing framework is configured (not PHPUnit directly)- 🔧
usesRector()- Validates Rector automated code modernization is installed (partial: fixes ci-lint script if packages installed) usesLarastan()- Validates Larastan static analysis tool is configuredusesPhpstanExtensions()- Validates PHPStan extensions are installedphpstanLevelAtLeastEight()- Validates PHPStan is configured to at least level 8- 🔧
usesPhpInsights()- Validates PHP Insights code quality analysis is configured (partial: fixes ci-lint scripts if package installed) - 🔧
checkPhpunit()- Validates PHPUnit configuration with coverage reports (adds missing XML nodes and APP_KEY) - 🔧
hasRectorConfigWithComposerBased()- Validates RectorwithComposerBased(phpunit, symfony, laravel)is configured (appends call to rector.php) - 🔧
hasRectorConfigWithConfiguredRules()- Validates RectorwithConfiguredRule()calls are present forRouteActionCallableRectorandWhereToWhereLikeRector(appends calls to rector.php) - 🔧
hasRectorConfigWithPreparedSets()- Validates RectorwithPreparedSets(deadCode, codeQuality, codingStyle, typeDeclarations, privatization, instanceOf, earlyReturn)is configured (appends call to rector.php) - 🔧
hasRectorConfigWithImportNames()- Validates RectorwithImportNames(importShortClasses: false)is configured (appends call to rector.php) - 🔧
hasRectorConfigWithPhpSets()- Validates RectorwithPhpSets()is called (appends call to rector.php) - 🔧
hasRectorConfigWithAttributesSets()- Validates RectorwithAttributesSets()is called (appends call to rector.php) - 🔧
hasRectorConfigWithSetProviders()- Validates RectorwithSetProviders(LaravelSetProvider)is configured (appends call to rector.php) - 🔧
hasRectorConfigWithRules()- Validates RectorwithRules([AddGenericReturnTypeToRelationsRector, MinutesToSecondsInCacheRector, UseForwardsCallsTraitRector])is configured (appends call to rector.php) - 🔧
hasRectorConfigWithSets()- Validates RectorwithSets([LaravelBaselineSetList::REMOVE_DEFAULT_DOCBLOCKS, LaravelSetList::LARAVEL_*])is configured with all required sets (appends call to rector.php) - 🔧
hasRectorConfigWithPaths()- Validates RectorwithPaths([app, database, routes, tests])is configured (appends call to rector.php) - 🔧
hasRectorConfigWithSkip()- Validates RectorwithSkip()contains required skipped rules (always: 6 Laravel rules; Laravel 13+: TablePropertyToTableAttributeRector; when server.php exists: ServerVariableToRequestFacadeRector) (appends call to rector.php)
IDE & Developer Tools
- 🔧
hasEditorconfig()- Validates.editorconfigexists with required settings (root = true,charset,end_of_line,indent_style,insert_final_newline,trim_trailing_whitespace) (creates.editorconfigwith canonical content if missing or incomplete) - 🔧
hasClaudeSettingsWithLaravelSkills()- Validates Claude Code settings include the Laravel agent skills plugin and marketplace (creates/merges.claude/settings.json) - 🔧
doesNotHaveLaravelSimplifierInClaudeSettings()- Fails if the deprecatedlaravel-simplifier@laravelplugin is still enabled in.claude/settings.json(removes the entry) - 🔧
usesIdeHelpers()- Validates Laravel IDE Helper is configured (partial: adds post-update scripts if package installed) usesLaravelAdminer()- Warns if Laravel Adminer database UI is missing (optional), validates TFA confirmation and configuration when installed- 🔧
usesLaravelBoost()- Validates Laravel Boost AI development tool (partial: fixes boost.json and post-update script if package installed) - 🔧
laravelBoostMcpUsesDdev()- Validates.mcp.jsonconfigures thelaravel-boostMCP server to useddev artisan boost:mcp(creates/fixes.mcp.json; warns iflaravel/boostnot installed) runsBoostUpdate()(periodic, every 30 days) - Warns if Laravel Boost is not installed; when installed, fails until a developer confirms runningphp artisan boost:update --discovervialimenet:laravel-baseline:periodic- 🔧
usesLimenetPintConfig()- Validates custom Laravel Pint formatting standards (partial: adds post-update script if package installed)
Laravel Features & Monitoring
- 🔧
usesLaravelHorizon()- Validates Laravel Horizon Redis queue manager (partial: adds ci-deploy-post script if package installed) usesLaravelPennant()- Warns if Laravel Pennant feature flags are missing (optional)- 🔧
usesLaravelPulse()- Validates Laravel Pulse application monitoring (partial: adds PULSE_ENABLED=false to phpunit.xml if package installed) - 🔧
usesLaravelTelescope()- Validates Laravel Telescope request debugging (partial: adds post-update script and TELESCOPE_ENABLED=false to phpunit.xml if package installed) usesSpatieHealthSetup()- Validates Spatie Health packages, schedules, s3_health disk, and result store configuration- 🔧
usesSpatieHealthHasCoreChecks()- Validates core health checks (CacheCheck, CpuLoadCheck, DatabaseCheck, DatabaseConnectionCountCheck, DebugModeCheck, EnvironmentCheck, HorizonCheck, QueueCheck, RedisCheck, ScheduleCheck, UsedDiskSpaceCheck) are registered (adds missing checks to Health::checks() in AppServiceProvider) - 🔧
usesSpatieHealthHasLaravelVersionCheck()- Validates LaravelVersionCheck is registered in Health::checks() (adds to AppServiceProvider) - 🔧
usesSpatieHealthHasPhpVersionCheck()- Validates PhpVersionCheck is registered in Health::checks() (adds to AppServiceProvider) - 🔧
usesSpatieHealthHasReleaseAgeCheck()- Validates ReleaseAgeCheck is registered in Health::checks() (adds to AppServiceProvider) usesSpatieHealthQueueCheckCacheStore()- Validates QueueCheck: DispatchQueueCheckJobsCommand is scheduled everyMinute(), uses the dedicated 'health-checks' file cache store in AppServiceProvider and config/cache.phpusesSpatieHealthQueueCheckHorizonQueues()- Validates QueueCheck registers all queues from config/horizon.php via onQueue() (requires laravel/horizon)usesSpatieHealthScheduleCheckCacheStore()- Validates ScheduleCheck uses the dedicated 'health-checks' cache store in both AppServiceProvider and config/cache.phpusesSpatieBackup()- Validates Spatie Backup database backups with comprehensive config validation
Infrastructure & Dependencies
usesPredis()- Validates Predis Redis client is installedisLaravelVersionMaintained()- Validates Laravel 11+ is used- 🔧
doesNotUseSail()- Validates Sail is NOT used (partial: deletes docker-compose.yml; runcomposer remove laravel/sailmanually) doesNotUseSpatiePasskeysWithFortify()- Fails if bothspatie/laravel-passkeysandlaravel/fortifyare installed, as they overlap in authentication responsibilitydoesNotUseHorizonWatcher()- Validates Spatie Horizon Watcher is NOT installed- 🔧
doesNotUseGreaterThanOrEqualConstraints()- Validates no>=version constraints in composer.json (use^or~instead) (replaces>=X.Ywith^X.Yin composer.json)
CI/CD & Deployment
hasCiJobs()- Validates GitLab CI pipeline jobs are properly configured- 🔧
hasTrivyConfig()- Validates Trivy security scanning CI job andtrivy.yamlconfiguration (scanners + severity) (creates/merges trivy.yaml and adds CI job) callsSentryHook()- Warns if Sentry error tracking is missing (optional)phpVersionMatchesCi()- Validates PHP version consistency with CI configurationisCiLintComplete()- Validates complete linting pipelinedoesNotUseIgnition()- Validates Ignition debugger is NOT installed
Local Development
phpVersionMatchesDdev()- Validates PHP version consistency with DDEV- 🔧
ddevHasPcovPackage()- Validates DDEV coverage configuration (adds pcov to webimage_extra_packages and creates .ddev/php/90-custom.ini) ddevHasRedisAddon()- Validates DDEV Redis addon is installed and at minimum version 2.2.0- 🔧
ddevMutagenIgnoresNodeModules()- Validates DDEV Mutagen sync configuration (creates mutagen.yml and fixes .gitignore)
Build & Release
- 🔧
bumpsComposer()- Validates automatic composer dependency bumping (addscomposer bumpto post-update-cmd) - 🔧
usesReleaseIt()- Validates automated release management (partial: creates/fixes .release-it.json and adds release npm script if packages installed) hasNpmScripts()- Validates required npm build scripts
Security & Configuration
- 🔧
modelShouldBeStrict()- ValidatesModel::shouldBeStrict()is called in AppServiceProvider withtrue, no argument, or a dynamic expression (notfalse) (addsModel::shouldBeStrict(! app()->isProduction())to boot()) - 🔧
formRequestFailOnUnknownFields()- ValidatesFormRequest::failOnUnknownFields()is called in AppServiceProvider (Laravel ≥13.6 only; warns on older versions) (addsFormRequest::failOnUnknownFields(! app()->isProduction())to boot()) hasDailyLogging()- Validates logging usesdailychannel (directly or viastack)hasEncryptedEnvFile()- Validates encrypted environment file exists- 🔧
hasGuidelinesUpdateScript()- Validates baseline guidelines update script (adds to post-update-cmd, ordered before boost:update) - 🔧
callsBaseline()- Validates self-validation runs after updates (adds/upgrades post-update-cmd entry to include--fix) doesNotCallPeriodicBaselineOnUpdate()- Fails ifphp artisan limenet:laravel-baseline:periodicis in thepost-update-cmdscripts (it shouldn't be — periodic checks fail CI automatically when expired)- 🔧
isInstalledAsRegularDependency()- Validateslimenet/laravel-baselineis inrequire(notrequire-dev) (moves from require-dev to require in composer.json) - 🔧
usesLaravelLang()- Validateslaravel-lang/langdev dependency is installed withlang:updateand pint in post-update scripts (partial: adds post-update scripts if package in require-dev)
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.