Laravel 13 new project setup checklist
A Laravel new project setup checklist for Laravel 13 covering Sail, PHP pinning, Pint, Larastan, Rector, Pest, Vet, Boost, the first commit and CI.
Updated
On this page
- 1. Create the app with Pest and git
- 2. Install Sail with the services you need
- 3. Pin the PHP version in composer.json
- 4. Add Pint with a stricter config
- 5. Add PHPStan with Larastan
- 6. Add Rector with the Laravel sets
- 7. Keep Pest and write one real test
- 8. Generate IDE helper stubs
- 9. Wire composer quality scripts
- 10. Record your dependencies with Laravel Vet
- 11. Install Laravel Boost for your AI agents
- 12. Fill env and mail placeholders
- 13. Make the first commit green
- 14. Run the same gate in CI
- The checklist at a glance
- Skip the setup
This is a Laravel new project setup checklist for Laravel 13: the steps that sit between laravel new and the first feature. Run Sail with the services you need, pin PHP in composer.json, add Pint, PHPStan with Larastan and Rector with ready configs, keep Pest, generate IDE helper stubs, wire one composer quality script, record your dependencies with Laravel Vet, install Laravel Boost for your AI agents, make a clean first commit and run the same gate in CI.
Each item below says what it is, why it matters, and the exact command or config. Commands assume Sail, so they are prefixed with ./vendor/bin/sail. Drop the prefix if PHP runs on your host.
1. Create the app with Pest and git
laravel new my-app --pest --git
cd my-app
Why: --pest picks the test runner before any test exists, so you never convert later. --git initializes the repository and makes an initial commit. Add a starter kit flag (--react, --vue, --livewire, --svelte) if you want one.
2. Install Sail with the services you need
Sail is Laravel's Docker Compose setup. It gives every developer and every agent the same PHP, the same database and the same extensions.
composer require laravel/sail --dev
php artisan sail:install --with=mysql,redis,mailpit --php=8.5
./vendor/bin/sail up -d --wait
Why: the host PHP version stops mattering. Pick the database you run in production (mysql, pgsql, mariadb), add redis for cache and queues, and mailpit to catch outgoing mail locally.
Two things to check:
- Ports. Sail binds
APP_PORT,FORWARD_DB_PORTand friends on the host. If you run several projects, set different values in.envbeforesail up, or the second project fails with "port is already allocated". --php. It pins the runtime incompose.yaml. Use a version Sail ships a runtime for.
From here on, run everything through Sail.
3. Pin the PHP version in composer.json
Two settings, two jobs:
{
"require": {
"php": "^8.5"
},
"config": {
"platform": {
"php": "8.5.0"
}
}
}
Or from the command line:
./vendor/bin/sail composer config platform.php 8.5.0
Why: require.php declares which PHP the app supports. config.platform.php tells Composer which PHP to resolve packages for, whatever PHP runs composer. Without the platform pin, a composer update on a host with a different PHP can lock versions the container cannot run, or skip versions it could. Set the platform version at or below the container's real PHP version, never above it.
4. Add Pint with a stricter config
Pint ships with Laravel. The default laravel preset is a good base. Add the rules that make files consistent:
{
"preset": "laravel",
"exclude": [
"bootstrap/cache",
"storage"
],
"rules": {
"declare_strict_types": true,
"final_class": true,
"fully_qualified_strict_types": true,
"global_namespace_import": {
"import_classes": true,
"import_constants": true,
"import_functions": true
},
"strict_comparison": true,
"strict_param": true
}
}
./vendor/bin/sail bin pint --test # check only
./vendor/bin/sail bin pint # fix
Why: formatting debates end and diffs stay small. declare_strict_types and strict_comparison change behavior, not just style, so turn them on while the codebase is empty. Details and trade-offs: Laravel Pint config.
5. Add PHPStan with Larastan
./vendor/bin/sail composer require --dev larastan/larastan
phpstan.neon.dist:
includes:
- vendor/larastan/larastan/extension.neon
- vendor/nesbot/carbon/extension.neon
parameters:
level: 7
paths:
- app
- bootstrap/app.php
- config
- database
- routes
./vendor/bin/sail bin phpstan analyse
Why: Larastan teaches PHPStan about facades, Eloquent, the container and magic properties, so it finds real type errors instead of false positives. On a fresh app you can start at a high level and stay green. Level choice, baselines and common errors: PHPStan with Larastan.
6. Add Rector with the Laravel sets
./vendor/bin/sail composer require --dev rector/rector driftingly/rector-laravel
rector.php:
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withPaths([
__DIR__.'/app',
__DIR__.'/database',
__DIR__.'/routes',
__DIR__.'/tests',
])
->withPhpSets()
->withPreparedSets(
codeQuality: true,
deadCode: true,
earlyReturn: true,
typeDeclarations: true,
)
->withSets([
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_COLLECTION,
LaravelSetList::LARAVEL_IF_HELPERS,
]);
./vendor/bin/sail bin rector --dry-run # show changes
./vendor/bin/sail bin rector process # apply them
Why: Rector applies refactors mechanically: modern PHP syntax, dead code removal, added type declarations, Laravel idioms. Later it does framework upgrades for you. Run Rector before Pint, because Rector's printed code does not follow your Pint style. Full setup: Rector for Laravel.
7. Keep Pest and write one real test
laravel new --pest already gives you tests/Pest.php, a feature test and a unit test.
./vendor/bin/sail artisan test --compact
Why: the first test is the hardest to write because nothing is set up for it. Confirm the suite runs inside Sail against the right database before you add features. If tests should use a separate database, set it in phpunit.xml.
8. Generate IDE helper stubs
./vendor/bin/sail composer require --dev barryvdh/laravel-ide-helper
Add the generated files to .gitignore:
_ide_helper.php
_ide_helper_models.php
.phpstorm.meta.php
Generate them:
./vendor/bin/sail artisan ide-helper:generate
./vendor/bin/sail artisan ide-helper:meta
./vendor/bin/sail artisan ide-helper:models --nowrite
Why: your editor and your AI agent get autocompletion for facades, container bindings and model attributes. --nowrite keeps model PHPDoc in _ide_helper_models.php instead of rewriting your model files. Run ide-helper:models with the containers up, because it reads the database schema.
9. Wire composer quality scripts
Put every check behind one name. In composer.json:
{
"scripts": {
"pint:dry": "vendor/bin/pint --test",
"pint:fix": "vendor/bin/pint",
"phpstan": "vendor/bin/phpstan analyse",
"phpstan-clear": "vendor/bin/phpstan clear-result-cache",
"ide-helper": [
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta",
"@php artisan ide-helper:models --nowrite"
],
"rector:dry": "vendor/bin/rector --dry-run",
"rector:fix": "vendor/bin/rector process",
"quality": [
"@pint:dry",
"@phpstan",
"@rector:dry"
]
}
}
./vendor/bin/sail composer quality
Why: humans, git hooks, CI and agents all run the same command. quality only checks, it never writes, so it is safe as a gate. The :fix scripts are for local use.
Before you commit, run the fixers once over the whole skeleton so quality starts green:
./vendor/bin/sail composer rector:fix
./vendor/bin/sail composer pint:fix
./vendor/bin/sail composer quality
10. Record your dependencies with Laravel Vet
Laravel Vet is a Composer plugin that gates every install against a trust file, vet.json. A package version nobody has reviewed is shown as a diff and refused.
./vendor/bin/sail composer require --dev laravel/vet
./vendor/bin/sail php vendor/bin/vet --init
Composer asks to allow the plugin. The result in composer.json:
{
"config": {
"allow-plugins": {
"laravel/vet": true
}
}
}
Add a vet script ("vet": "vendor/bin/vet") and append @vet to quality. Commit vet.json.
Why: a fresh app pulls in well over a hundred packages. Supply-chain attacks arrive as a new release of one of them. Vet makes every dependency change a reviewed change. Review new versions with ./vendor/bin/sail composer vet in a real terminal. It cannot prompt from a script or CI job, so there it only reports and exits 1. See packages are not trusted if every composer command starts failing.
Vet can also hold back releases younger than N days (minimum-release-age). Turning it on in an existing app takes a specific order of commands: turning on minimum-release-age.
11. Install Laravel Boost for your AI agents
Boost gives coding agents version-specific Laravel guidelines, skills and an MCP server with tools to read your schema, logs, routes and docs.
./vendor/bin/sail composer require laravel/boost --dev
./vendor/bin/sail artisan boost:install
Pick the agents you use (Claude Code, Cursor, Codex, Copilot and others). Boost writes boost.json, the agent guideline files and the MCP config. Add skills from GitHub with boost:add-skill <owner/repo>, and refresh everything with boost:update.
Why: an agent that knows it is on Laravel 13, Pest 4 and Sail writes code that matches your project, and runs your quality scripts instead of guessing. Details: Laravel Boost and AI agents.
If agents drive the app, also consider blocking destructive database commands (migrate:fresh, db:wipe) while an agent is detected. Laravel already prohibits them in production through DB::prohibitDestructiveCommands().
12. Fill env and mail placeholders
Check .env and .env.example before the first commit:
| Key | What to set |
|---|---|
APP_NAME |
Your app name, used in mail and notifications |
APP_URL |
http://localhost plus APP_PORT if you changed it |
DB_* |
Set by sail:install for the chosen database |
MAIL_MAILER, MAIL_HOST, MAIL_PORT |
Mailpit locally; your provider in production |
| Provider keys | Empty placeholders, for example POSTMARK_API_KEY= |
Why: .env.example is the documentation for every setting the app reads. Add a key there the moment you add it to config, with an empty or safe value. Never commit real secrets.
13. Make the first commit green
./vendor/bin/sail artisan migrate
./vendor/bin/sail npm install
./vendor/bin/sail composer quality
./vendor/bin/sail artisan test --compact
git add -A
git commit -m "chore: set up application"
Why: the first commit is your known-good baseline. If quality and tests pass there, every later failure belongs to a later change. A git diff against it tells you exactly what a feature or an agent changed.
14. Run the same gate in CI
A minimal GitHub Actions workflow, .github/workflows/ci.yml:
name: CI
on:
push:
pull_request:
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
coverage: none
- run: composer install --no-interaction --prefer-dist
- run: cp .env.example .env && php artisan key:generate
- run: composer quality
- run: php artisan test --compact
Why: CI runs composer quality, the same script you run locally, so there is one definition of green. Use the PHP version you pinned in step 3. If you added @vet to quality, CI fails on any dependency change nobody reviewed. That is the point.
The checklist at a glance
| Step | Tool | Command or file |
|---|---|---|
| Create | Laravel installer | laravel new my-app --pest --git |
| Containers | Sail | sail:install --with=... --php=8.5 |
| PHP pin | Composer | require.php, config.platform.php |
| Format | Pint | pint.json |
| Static analysis | PHPStan + Larastan | phpstan.neon.dist |
| Refactor | Rector + rector-laravel | rector.php |
| Tests | Pest | artisan test |
| Editor stubs | laravel-ide-helper | composer ide-helper |
| One gate | Composer scripts | composer quality |
| Supply chain | Laravel Vet | vet.json |
| AI agents | Laravel Boost | boost.json |
| Config | .env.example |
placeholders |
| Baseline | git | green first commit |
| CI | GitHub Actions | composer quality |
Skip the setup
Doing this list by hand takes an afternoon, and it drifts a little every time. kalimera runs it in one unattended pass: laravel new with Pest and git, Sail with your services and PHP runtime (busy host ports remapped), require.php and the Composer platform pin, Pint, PHPStan with Larastan and IDE Helper, Rector, the composer scripts above, your own packages, Laravel Vet, Laravel Boost with your agents and skills, and a guard against destructive database commands under AI agents. It then formats the skeleton with Rector and Pint, checks that composer quality is green and commits. Every choice is asked once upfront or read from kalimera.config.json.
composer global require welldigit/kalimera
kalimera new my-app
All of it, in one unattended run.
kalimera makes these choices once, upfront, then scaffolds a fresh Laravel app with every piece wired and committed.