Setup PHP Laravel
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffolds a Laravel application with composer create-project laravel/laravel (or brings an existing app up to date), then layers this catalog’s standard PHP toolchain on top so the CI workflows and the iru-php-* gate skills work against it without further wiring.
Purpose
iru-setup-php-laravel resolves the latest stable skeleton live from Packagist, scaffolds into a scratch directory and moves the result into the repository without overwriting anything that already exists. It then post-processes the app:
-
config/app.phpgets a'version' ⇒ env('APP_VERSION', '0.1.0-dev')key in thex.y.z-devshape thatiru-php-bump-versionmaintains, andconfig.platform.phpis pinned to the PHP floor. -
Pest (default, with arch tests using the php/security/laravel presets) or PHPUnit, with fast Unit and Feature suites on SQLite
:memory:. -
Pint (
pint.json) and Larastan (phpstan.neon) — level 9 for a new app, a lower level plus a generated baseline for an existing one. -
Composer scripts the workflows and gates call by name:
test,test:coverage(Clover and JUnit underbuild/logs/, 80% floor),lint,lint:report,format,format:check. -
A sample action, Form Request, policy and resource with feature tests (never added to an existing app without asking).
-
Browser UI tests per the catalog’s UI contract (see Building user interfaces):
.ui-quality.yml, Playwright (playwright.config.tsservingphp artisan serve) with@axe-core/playwright, the sharedtests/e2e/support/ui-screenshots.tshelper and aWelcomePagespec that captures.ui-screenshots/screen/WelcomePage/across left-to-right/right-to-left x light/dark with an accessibility check. Withaccessibility: noneno accessibility tooling is installed and the templates omit assistive-technology attributes; otherwise they carry them. Two small edits towelcome.blade.php(a locale-drivendirattribute and an accessible link colour) make the sample pass underaccessibility: enforce. Details live inreference/sample-code.md. -
Only when chosen: a database-backed
Integrationsuite (MySQL or PostgreSQL), Laravel Sail, a productionDockerfile(FrankenPHP or PHP-FPM + Nginx) fordistribution: internal,sonar-project.properties, and Laravel Boost as a dev-only dependency.
The skill announces whether it is scaffolding from scratch or updating an existing app. For every artifact it owns that already exists it warns and asks Update / Keep as is / Replace (or Stop), unless on-existing pre-answers. Replace is never offered for the application itself, since re-running create-project would overwrite live code. The browser UI tests serialize behind the shared .integration-test.lock and are reported unverified when Node, a browser or a servable PHP is missing. It ends by running the same commands the iru-php-test, iru-php-coverage and iru-php-code-quality gates run, and reports what it could not verify rather than assuming it works.
Plugin
Shipped by the iru-php plugin of the ai-catalog marketplace (install with /plugin install iru-php@ai-catalog; see Plugins).
Invocation
/iru-setup-php-laravel
When called from iru-setup-php-repository, the resolved answers arrive as args key: value lines.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Identity: |
Asked (existing apps: read from |
|
No |
|
Asked |
|
No |
PHP floor ( |
Latest branch in active support |
|
No |
Shared pipeline vocabulary. |
Asked or derived ( |
|
No |
|
|
|
No |
|
|
|
No |
|
Asked; |
|
No |
|
|
|
No |
|
|
|
No |
|
Sail |
|
No |
|
|
|
No |
|
Derived: Laravel app present means |
|
No |
|
|
Unknown keys are ignored. A composer.json that is not a Laravel app makes the skill stop and suggest iru-setup-php-repository.
Outputs
-
A Laravel application at the repository root (or a
<slug>subdirectory), withcomposer.lockand the identity, version key and platform pin applied. -
phpunit.xml(fast suites),tests/Pest.phpandtests/Unit/ArchTest.php(Pest),pint.json,phpstan.neon(+ baseline for an existing app), and the composer scripts. -
The sample slice and its tests, optionally
phpunit.integration.xml, Sail files,Dockerfile/.dockerignore,sonar-project.properties, Boost files and guidelines. -
.ui-quality.yml,playwright.config.ts,tests/e2e/support/ui-screenshots.ts,tests/e2e/specs/WelcomePage.spec.ts, Playwright and axe-core devDependencies and atest:e2enpm script. -
/build/,.ui-screenshots/,/test-results/,/playwright-report/,/blob-report/and/playwright/.cache/entries appended to.gitignorewhen no line covers them. -
A report: mode, toolchain used (host or Docker image), resolved versions and their source, the action per owned artifact (created / updated / replaced / kept as is / removed / skipped), each gate command and result, the browser UI test result (screenshot count, accessibility violations, the client-side direction fallback while the app has no locale-selection mechanism), anything unverified, and a warnings block (never commit
.env, coverage needs PCOV or Xdebug, Boost runs with developer credentials, aSONAR_TOKENis needed).
Execution flow
Dependencies
Invokes
None. It runs composer, php, vendor/bin/* and optionally docker directly. Step 15 runs the same commands as the iru-php-test, iru-php-coverage and iru-php-code-quality gates, but does not call those skills. The sample code follows iru-php-code-one-task/reference/laravel.md, and the UI test helper mirrors the API documented in `iru-php-code-one-task’s UI guidance.
Invoked by
-
Setup PHP Repository — Step 5, scaffold for the laravel flavor, via the
iru-isolated-skill-executoragent.
Source
SKILL.md on GitHub — the file this page was generated from.