mrsafalpiya / strictly-laravel
Strictly Laravel: end-to-end type safety for Laravel + Inertia + React, applied as an Overlay on the official React starter kit.
Requires
- php: ^8.4
- illuminate/console: ^13.0
- illuminate/database: ^13.0
- illuminate/support: ^13.0
- inertiajs/inertia-laravel: ^3.0
- larastan/larastan: ^3.9
- nette/neon: ^3.4
- pestphp/pest-plugin-phpstan: ^5.2
- pestphp/pest-plugin-type-coverage: ^5.0
- phpstan/phpstan: ^2.3
- phpstan/phpstan-strict-rules: ^2.1
- spatie/laravel-data: ^4.23
- spatie/laravel-typescript-transformer: ^3.3
- tomasvotruba/type-coverage: ^2.5
Requires (Dev)
None
Suggests
- laravel/boost: Required as a dev dependency (composer require laravel/boost --dev): it installs the Strictly Laravel guidance for AI coding agents, and strictly:install checks it is there.
Provides
None
Conflicts
- laravel/boost: <2.10 || >=3.0
Replaces
None
README
The Composer package of Strictly Laravel, which adds end-to-end type safety to a Laravel + Inertia + React app built on the official React starter kit. You write PHP, and the TypeScript types are generated from it. The app's composer ci:check then fails when React reads a prop, form field, route, query key, translation or broadcast payload that the server doesn't send.
This package has the Data class base types, the type generator, the PHPStan rules, Contract recording and the strictly:* artisan commands. It needs the npm package @mrsafalpiya/strictly-laravel at the same version.
Install
You need PHP 8.4, Laravel 13, Node 26 and pnpm.
laravel new my-app --react --pest --pnpm
cd my-app
composer require mrsafalpiya/strictly-laravel
composer require laravel/boost --dev
pnpm add @mrsafalpiya/strictly-laravel
php artisan strictly:install
composer ci:check
strictly:install edits the app's tooling and converts the starter kit's own pages, controllers and types, for whichever of the kit's auth features the app kept. It prints one row per change and never overwrites a file it doesn't recognise.
To update, follow UPGRADE.md.
Source and issues
The source of this package is in packages/laravel of the strictly-laravel monorepo. Open issues and pull requests there.
License
MIT. See LICENSE.