Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4531 commits
Select commit Hold shift + click to select a range
ba1c809
Converting Login related javascript to web components
brianjhanson May 13, 2026
95dc221
Visually hidden WC styles
brianjhanson May 13, 2026
29ebf18
Add configurable compiled templates path
riasvdv May 13, 2026
c996a6e
Ignore missing transaction during plugin uninstall
riasvdv May 13, 2026
5de6deb
Remove dangling spinner reference
brianjhanson May 13, 2026
c52976f
Update ElevatedSessionManager.js to use new events
brianjhanson May 13, 2026
b225ebb
Cleanup
brianjhanson May 13, 2026
e948c3d
Build
brianjhanson May 13, 2026
c90ba0c
Update AuthManager for new form
brianjhanson May 13, 2026
3e4a4d0
Rebuild
brianjhanson May 13, 2026
f774a29
Merge branch '6.x' of github.com:craftcms/cms into feature/craft-logi…
brianjhanson May 13, 2026
b2c7e1d
Merge branch 'feature/inertia-auth' of github.com:craftcms/cms into f…
brianjhanson May 13, 2026
ca6aa0e
Merge branch 'feature/craft-login-form-web-component' of github.com:c…
brianjhanson May 13, 2026
739eb90
Make sure recovery codes work
brianjhanson May 13, 2026
c431f9c
Remove old two factor asset bundle and JS
brianjhanson May 13, 2026
da02ad9
Release note
brandonkelly May 13, 2026
58380e2
Merge pull request #18858 from craftcms/rias/cms-2078-redirect-goes-t…
brandonkelly May 13, 2026
7540d2f
Release note
brandonkelly May 13, 2026
34b63c1
Merge branch '6.x' into rias/cms-2080-ignore-missing-transaction-exce…
brandonkelly May 13, 2026
9bf824a
Merge pull request #18862 from craftcms/rias/cms-2080-ignore-missing-…
brandonkelly May 13, 2026
cfecd3a
Merge branch '6.x' into feature/configurable-compiled-templates
brandonkelly May 13, 2026
0529e06
Release note
brandonkelly May 13, 2026
a66b79e
Merge pull request #18861 from craftcms/feature/configurable-compiled…
brandonkelly May 13, 2026
a035e47
Cleanup
brianjhanson May 14, 2026
f557c07
Fix queue polling: add backoff for no-displayable-job state and guard…
brianjhanson May 14, 2026
5f32d0c
Improve check for running jobs
brianjhanson May 14, 2026
821f63e
Merge branch '6.x' into rias/cms-2077-6x-response-redirecturl-method-…
riasvdv May 14, 2026
9e5a854
Changelog
riasvdv May 14, 2026
893c922
Add missing minAuthors migration
riasvdv May 14, 2026
8eba7f4
Merge branch '6.x' into brian/cms-2076-6x-infinite-queue-polling-in-c…
brandonkelly May 14, 2026
ca886ef
Release note
brandonkelly May 14, 2026
d49fd59
Merge pull request #18867 from craftcms/brian/cms-2076-6x-infinite-qu…
brandonkelly May 14, 2026
22ed5a2
Merge branch '6.x' into rias/cms-2077-6x-response-redirecturl-method-…
brandonkelly May 14, 2026
8a69bfa
Merge pull request #18860 from craftcms/rias/cms-2077-6x-response-red…
brandonkelly May 14, 2026
dd1cf93
Move some vite config aroujnd
brianjhanson May 14, 2026
8261f72
Cache busting
brianjhanson May 14, 2026
4e8b17f
Use the CMS version
brianjhanson May 14, 2026
c4ca268
Fix path
brianjhanson May 14, 2026
6203db8
A few more
brianjhanson May 14, 2026
188b47c
Fix user draft email apply
riasvdv May 14, 2026
db04e19
Changelog
riasvdv May 14, 2026
ff9a8f8
Allow stringable CP HTML values
riasvdv May 14, 2026
62e3841
Add changelog entry for stringable CP HTML values
riasvdv May 14, 2026
68b402f
Changelog
riasvdv May 14, 2026
b285551
Put the icons back
brianjhanson May 14, 2026
b5e4e67
Run caniuse-lite update
brianjhanson May 14, 2026
389bd24
Fix reference
brianjhanson May 14, 2026
00d616e
Don't publish PHP files
brianjhanson May 14, 2026
269894e
Fix up front-end icon references
brianjhanson May 14, 2026
978fa44
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
a44af7d
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
1d87a8e
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
72f2924
Merge pull request #18875 from craftcms/bugfix/missing-min-authors-mi…
brandonkelly May 14, 2026
ca3a309
Merge branch '6.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
fff8e52
Make sure the sections.minAuthors migration has been run
brandonkelly May 14, 2026
985aa15
Bump the schema version too
brandonkelly May 14, 2026
50263bd
Fixes
brandonkelly May 14, 2026
1e0c50d
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
80496b1
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
d266b94
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 14, 2026
b2284c1
Merge branch '6.x' into rias/cms-2089-6x-email-cannot-be-set-on-users
brandonkelly May 14, 2026
eea7a9d
Merge pull request #18882 from craftcms/rias/cms-2089-6x-email-cannot…
brandonkelly May 14, 2026
d66dc4f
Merge pull request #18883 from craftcms/rias/cms-2088-6x-error-when-s…
brandonkelly May 15, 2026
c31f97b
Merge branch '6.x' into feature/vite-improvements
brandonkelly May 15, 2026
2c7870c
Merge branch '6.x' of github.com:craftcms/cms into feature/vite-impro…
brianjhanson May 15, 2026
b3138f8
Merge branch 'feature/vite-improvements' of github.com:craftcms/cms i…
brianjhanson May 15, 2026
3df3fa2
More memory efficient publishing
brianjhanson May 15, 2026
055af4d
Fix updater utility
brianjhanson May 15, 2026
bd09c81
Adjust plugin config merge order
riasvdv May 15, 2026
fc116d2
Changelog
riasvdv May 15, 2026
e59256a
Fix blank element source headings
riasvdv May 15, 2026
c26de38
Changelog
riasvdv May 15, 2026
e393bfb
Wait for cached data
brianjhanson May 15, 2026
edb7ce9
Remove `viteAsset` twig function
brianjhanson May 15, 2026
ff9bd38
Clone vite
brianjhanson May 15, 2026
046bbf6
Remove leading slash
brianjhanson May 15, 2026
65a3620
Guard against `realpath` returning false
brianjhanson May 15, 2026
6c55102
Return types
brianjhanson May 15, 2026
a7c0b05
Merge branch '6.x' into feature/inertia-auth
brianjhanson May 15, 2026
70c48a2
Merge pull request #18880 from craftcms/feature/vite-improvements
brianjhanson May 15, 2026
a68548a
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-auth
brianjhanson May 15, 2026
a4916a4
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-auth
brianjhanson May 15, 2026
cdc4f17
Merge branch 'feature/inertia-auth' of github.com:craftcms/cms into f…
brianjhanson May 15, 2026
ab59ab1
Merge branch '6.x' into bugfix/updater-utility
brandonkelly May 15, 2026
8c9ba66
build
brandonkelly May 15, 2026
1776c0e
Add composerInstall to the maintenance mode exceptions
brandonkelly May 15, 2026
423ff38
Set isLoading = false *before* calling handleStateUpdate()
brandonkelly May 15, 2026
80be9d8
Release note
brandonkelly May 15, 2026
237934e
Merge pull request #18885 from craftcms/rias/cms-2092-adjust-plugin-c…
brandonkelly May 15, 2026
c36a580
Merge pull request #18884 from craftcms/bugfix/updater-utility
brandonkelly May 15, 2026
df63cbb
Merge pull request #18891 from craftcms/rias/cms-2095-6x-blank-headin…
brandonkelly May 15, 2026
92eca99
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 15, 2026
3109f49
Finish 6.0.0-alpha.3
brandonkelly May 15, 2026
14a4581
TOTP and recovery code setup
brianjhanson May 15, 2026
744ba0a
Create AuthChallengeForm component
brianjhanson May 15, 2026
decd34c
Build
brianjhanson May 15, 2026
584c6d5
Ensure challenge is recent
brianjhanson May 15, 2026
835d4ba
Add tests
brianjhanson May 15, 2026
db4c8fd
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-auth
brianjhanson May 15, 2026
6939d5e
PHPStan fixes
brianjhanson May 15, 2026
a2a267c
Cleanup
brianjhanson May 15, 2026
3afa2d8
Update Facade workflow back to Laravel
riasvdv May 15, 2026
df0f855
Merge pull request #18892 from craftcms/chore/update-facade-documenter
riasvdv May 15, 2026
261b36c
Add return type
brianjhanson May 15, 2026
a3921be
Update selector
brianjhanson May 15, 2026
266c6c8
Remove VarDump component
brianjhanson May 15, 2026
b726007
Cleanup logo styles a bit
brianjhanson May 15, 2026
09639e6
Uncomment prefers-reduced-motion media query
brianjhanson May 15, 2026
5ea56ef
Remove unnecessary macro impor
brianjhanson May 15, 2026
e2b0b8c
Smooth some rough edges
brianjhanson May 15, 2026
420fc5a
Build
brianjhanson May 15, 2026
18d1e72
Update test
brianjhanson May 15, 2026
ed329bd
Update types
brianjhanson May 15, 2026
8fa1659
Fix error display
brianjhanson May 15, 2026
2c95456
Uncommit vite change
brianjhanson May 15, 2026
21f4536
Build
brianjhanson May 15, 2026
d6e029f
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-auth
brianjhanson May 15, 2026
fc50203
Restore leagcy asset bundles to yii2-adapter
brianjhanson May 15, 2026
fb15501
Remove obsolete test
brianjhanson May 15, 2026
2c3767a
Fix legacy exception redirects
riasvdv May 16, 2026
13ff7a9
Don't generate loginUrl and logoutUrl if the config is set to false -…
riasvdv May 16, 2026
06b7d61
Add "Elements" tab to laravel-debugbar when installed
riasvdv May 16, 2026
b17946f
Add deprecations
riasvdv May 16, 2026
d178871
fix: normalize imagetransformindex dateIndexed for mysql datetime
patarok May 17, 2026
0f2f9f1
Normalize image transform index data for DB
riasvdv May 17, 2026
df92b9d
Changelog
riasvdv May 17, 2026
4d8c9a2
Merge pull request #18899 from patarok/fix/dateindexed-datetime
riasvdv May 17, 2026
0ace2af
Pint
riasvdv May 18, 2026
cbca897
Remove stray dump - fixes #18902
riasvdv May 18, 2026
491beea
Fix changelog order
riasvdv May 18, 2026
c309805
Merge pull request #18893 from craftcms/rias/cms-2077-6x-response-red…
riasvdv May 18, 2026
0b92673
Fix plugin Twig variable registration
riasvdv May 18, 2026
fec0227
Changelog
riasvdv May 18, 2026
a2ada32
Changelog
riasvdv May 18, 2026
50e74ac
Fix legacy cache not accepting new DependencyCache objects
riasvdv May 18, 2026
2cb4c1d
Changelog
riasvdv May 18, 2026
122ebc8
Fix legacy tests
riasvdv May 18, 2026
0e9da70
Catch setup issues in legacy tests
riasvdv May 18, 2026
43e33b1
Fix formatting of ol and ul
riasvdv May 18, 2026
b64920f
Fix original url not rendering when a legacy controller returns null
riasvdv May 18, 2026
7df9c7d
Changelog
riasvdv May 18, 2026
cb5e20e
Fix return type on ul and ol methods
riasvdv May 18, 2026
ea6dac2
Fix test
riasvdv May 18, 2026
780a83e
Fix flaky test + use snapshot for html test
riasvdv May 18, 2026
ecf5eba
Fix legacy filesystem bridging
riasvdv May 18, 2026
ea0c1f4
Changelog
riasvdv May 18, 2026
a64dbc5
Fix filesystem save null settings
riasvdv May 18, 2026
0d10be3
Changelog
riasvdv May 18, 2026
cdb205b
Rework AGENTS.md as the port is now complete + add laravel/pao in dev
riasvdv May 18, 2026
1b69c8d
Fix clearing empty submitted values
riasvdv May 18, 2026
307e9dd
Changelog
riasvdv May 18, 2026
c3260ac
Fix element selector modal source validation
riasvdv May 18, 2026
09bcdb4
Allow plugins to register scheduled tasks
riasvdv May 18, 2026
5b4438e
Changelog
riasvdv May 18, 2026
e477240
Register plugin routes with `web` middleware
riasvdv May 18, 2026
addcdcf
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 19, 2026
27d0854
Merge branch '6.x' into feature/debugbar
brandonkelly May 19, 2026
aeff62f
Release note
brandonkelly May 19, 2026
53e9990
Merge pull request #18897 from craftcms/feature/debugbar
brandonkelly May 19, 2026
d2f3662
Redundant
brandonkelly May 19, 2026
ae917cc
Reposition unreleased release notes
brandonkelly May 19, 2026
b24c03d
Merge branch '6.x' into rias/cms-2100-6x-plugin-twig-variable-not-reg…
brandonkelly May 19, 2026
799222e
Merge pull request #18903 from craftcms/rias/cms-2100-6x-plugin-twig-…
brandonkelly May 19, 2026
09e86bb
Merge branch '6.x' into rias/cms-2038-element-api-cant-use-when-cachi…
brandonkelly May 19, 2026
df48767
Merge pull request #18904 from craftcms/rias/cms-2038-element-api-can…
brandonkelly May 19, 2026
86aed18
Merge branch '6.x' into rias/cms-2102-6x-fields-retain-values-when-cl…
brandonkelly May 19, 2026
c61b904
Merge pull request #18914 from craftcms/rias/cms-2102-6x-fields-retai…
brandonkelly May 19, 2026
8462241
Merge branch '6.x' into rias/cms-2037-contact-form-404-when-submittin…
brandonkelly May 19, 2026
eb74fdd
Merge pull request #18907 from craftcms/rias/cms-2037-contact-form-40…
brandonkelly May 19, 2026
3049d7b
Merge branch '6.x' into rias/cms-2053-azure-blob-fs-settings-dont-save
brandonkelly May 19, 2026
a12038e
Merge pull request #18908 from craftcms/rias/cms-2053-azure-blob-fs-s…
brandonkelly May 19, 2026
7d2e0a0
Merge branch '6.x' into rias/cms-2052-aws-s3-google-cloud-setting-unk…
riasvdv May 19, 2026
13b6ad1
Merge branch '6.x' into rias/cms-2106-6x-the-sources-field-must-be-an…
riasvdv May 19, 2026
4a9c6b1
Merge pull request #18909 from craftcms/rias/cms-2052-aws-s3-google-c…
riasvdv May 19, 2026
362e3a1
Merge pull request #18915 from craftcms/rias/cms-2106-6x-the-sources-…
riasvdv May 19, 2026
53d78ea
Remove phpdocumentor/reflection-docblock as root dependency
riasvdv May 19, 2026
c9c4a1e
Remove dependencies not actually used by us
riasvdv May 19, 2026
b53ebd9
Update yiisoft/html
riasvdv May 19, 2026
c1b68f0
Changelog
riasvdv May 19, 2026
e2e980a
Update HTML stack test expectations
riasvdv May 19, 2026
526d508
Update license test expectation
riasvdv May 19, 2026
efa2493
Merge pull request #18920 from craftcms/feature/upgrade-yiisoft-html
riasvdv May 19, 2026
6288041
Upgrade google2fa to v9
riasvdv May 19, 2026
a2c0086
Merge pull request #18919 from craftcms/feature/upgrade-google2fa-v9
riasvdv May 19, 2026
19666ae
Upgrade Litemoji
riasvdv May 19, 2026
d27f4f4
Changelog
riasvdv May 19, 2026
ecdc4b6
Merge pull request #18917 from craftcms/rias/cms-1288-litemoji-6
riasvdv May 19, 2026
f37770b
Changelog for #18919
riasvdv May 19, 2026
a114565
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-auth
brianjhanson May 19, 2026
ee54048
Merge branch '6.x' into feature/plugin-scheduled-commands
riasvdv May 19, 2026
62c7b3c
Plain buttons don't extend past their container
brianjhanson May 19, 2026
4534dd3
Remove yii translations
brianjhanson May 19, 2026
4275561
Update status to 419 for expired
brianjhanson May 19, 2026
4f560b7
Fix phpstan
riasvdv May 19, 2026
937ccbb
fix attribute ordering in test
riasvdv May 19, 2026
1cf13ad
Merge branch '6.x' into feature/plugin-scheduled-commands
riasvdv May 19, 2026
f0aa91f
Make sure site and CP requests are handled
brianjhanson May 19, 2026
2890c8f
Fix adapter tests
riasvdv May 19, 2026
1b92594
Merge branch '6.x' into feature/plugin-scheduled-commands
riasvdv May 19, 2026
3750e5d
Adds IP key and tests
brianjhanson May 19, 2026
5ff1947
Fix username / email setting
brianjhanson May 19, 2026
561650f
Move validation server side
brianjhanson May 19, 2026
2faffe9
Build
brianjhanson May 19, 2026
75a90a0
Merge pull request #18916 from craftcms/feature/plugin-scheduled-comm…
riasvdv May 19, 2026
799c2f6
Add back support for rendeerViewWithFallback
brianjhanson May 19, 2026
8c1231b
Redundant
brandonkelly May 19, 2026
a531606
Recreate legacy app when it doesn't exist
riasvdv May 19, 2026
ab17779
Register CP template roots in middleware
riasvdv May 19, 2026
9a61a61
Register hooks in middleware
riasvdv May 19, 2026
661b914
Use Password rule
riasvdv May 19, 2026
9fcee9c
Fix phpstan
riasvdv May 19, 2026
d23d7df
Just add a phpstan-ignore
riasvdv May 19, 2026
3a11060
Merge pull request #18800 from craftcms/feature/inertia-auth
brianjhanson May 19, 2026
0c4393f
Refactor
riasvdv May 19, 2026
fad30cc
Phpstan fixes (again)
riasvdv May 19, 2026
770a279
Fix element index test
riasvdv May 19, 2026
97f4e4e
Finish 6.0.0-alpha.4
brandonkelly May 19, 2026
9b1c1cb
Merge branch '6.x' into feature/octane-compatibility
riasvdv May 20, 2026
a251338
Changelog
riasvdv May 20, 2026
f9df0dc
Add back the auth page powered by logo
riasvdv May 20, 2026
7eaa381
Add Carbon and UpdateRelease to serializable classes
riasvdv May 20, 2026
4bb0e3f
Move image
riasvdv May 20, 2026
ead7aa2
Merge branch '6.x' into feature/octane-compatibility
riasvdv May 20, 2026
d9d29e3
Merge branch '5.x' into 6.x
riasvdv May 20, 2026
2820ac1
Default loginPath to `false`
riasvdv May 20, 2026
c80a0b6
Fix tests
riasvdv May 20, 2026
f4871be
Fix redirects when loginPath is false
riasvdv May 20, 2026
313bbb8
Merge pull request #18922 from craftcms/feature/auth-logo
riasvdv May 20, 2026
30b5b35
Make sure money value is truthy
brianjhanson May 20, 2026
c8be82b
Update changelog entry
brianjhanson May 20, 2026
38a4a86
Merge pull request #18921 from craftcms/feature/octane-compatibility
brandonkelly May 20, 2026
394ca92
Fixed an issue preventing saving when link fields were present
brianjhanson May 20, 2026
e3737e7
Whoops, put item on correct changelog
brianjhanson May 20, 2026
9555ef3
Merge branch '5.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 20, 2026
58473b9
Merge pull request #18934 from craftcms/bugfix/save-link-fields
brandonkelly May 20, 2026
5c1349f
Merge branch '6.x' of https://github.com/craftcms/cms into 6.x
brandonkelly May 20, 2026
41507e0
Changelog tweaks
brandonkelly May 20, 2026
0dec920
Merge branch '6.x' into bugfix/money-value-prep
brandonkelly May 20, 2026
be542c2
Merge pull request #18930 from craftcms/bugfix/money-value-prep
brandonkelly May 20, 2026
90df382
Fix invalid query filters
riasvdv May 21, 2026
b5e73ad
Changelog
riasvdv May 21, 2026
35e28d4
URL should be Url
vnali May 21, 2026
84b0f60
Merge pull request #18940 from vnali/patch-24
riasvdv May 21, 2026
bcdf78c
Fix validatable preparation lifecycle
riasvdv May 21, 2026
3a9b9a2
Changelog
riasvdv May 21, 2026
b8a709e
Merge pull request #18937 from craftcms/rias/cms-2111-6x-query-for-no…
brandonkelly May 21, 2026
a527c97
Move setAttributes into trait
riasvdv May 22, 2026
42f370a
Rename ComponentRules to ValidatableRules
riasvdv May 22, 2026
c421a17
Merge branch '6.x' into feature/consistent-validatable-preparation
riasvdv May 22, 2026
9e962b1
Fix legacy implementation
riasvdv May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
64 changes: 64 additions & 0 deletions .agents/skills/artisan-command-authoring/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: artisan-command-authoring
description: Write and review Craft CMS Laravel Artisan commands using repository conventions. Use when adding or refactoring command classes in `src/**/Commands`, porting legacy Yii console controllers, or addressing review feedback on command signatures, aliases, prompts, output formatting, and Laravel service/facade usage.
---

# Artisan Command Authoring

## Overview
Implement or refactor commands so they match Craft CMS 6 Laravel patterns and pass common review checks the first time.

This skill now includes a Laravel 13 Prompts reference in `references/laravel-prompts-reference.md`.

## Workflow
1. Inspect neighboring command classes in the same domain and the domain service provider registration.
2. Define signature, aliases, arguments/options, injected services, and interactive behavior.
3. If the command is interactive, load `references/laravel-prompts-reference.md` and choose from the full prompt surface, not just basic text/confirm/select helpers.
4. Implement using Laravel-first APIs (services/facades/components/prompts), then preserve required backward-compatible aliases.
5. Run format + targeted tests and address findings.

## Command Construction Rules
- Use `final class ... extends Command` plus `use CraftCommand;`.
- Define `protected $signature`, `protected $description`, and `protected $aliases` explicitly.
- Read CLI inputs via `$this->argument()` / `$this->option()` inside `handle()`.
- Inject services into `handle()` (or constructor when needed) instead of pulling from globals.
- Prefer Laravel APIs over legacy Yii/Craft app APIs where equivalent exists.
- Keep compatibility aliases when replacing legacy commands.

## Output And Prompt Rules
- Use Laravel Prompts for interactive input and interactive command UX, including `search()`, `multisearch()`, `autocomplete()`, `form()`, `progress()`, `task()`, `stream()`, `title()`, and `clear()` when they fit.
- Prefer `$this->components->info|warn|error|success|task` for conventional Artisan status output in non-interactive or mixed flows.
- Prompt-side informational helpers (`info()`, `warning()`, `error()`, `alert()`, `note()`, `intro()`, `outro()`, `table()`) are valid when the command is intentionally using a Prompts-driven experience; avoid mixing both styles line-by-line without a reason.
- Avoid ad-hoc `output->write()`/`line()` for status messaging when components or prompt helpers fit.
- Gate interactive prompts with `$this->input->isInteractive()` and provide non-interactive fallbacks.
- Normalize prompt input with `transform:` before `validate:` when trimming or coercion would otherwise leak into validation logic.
- Keep labels, option text, and validation messages short enough for narrow terminals.
- In task closures, do not add unnecessary `return true;` values.
- Do not add manual blank-line spacing after component calls unless behavior requires it.

## When To Load References
- You need any prompt type beyond `text()`, `confirm()`, `select()`, or `multiselect()`.
- You need prompt validation/transform behavior or searchable prompt patterns.
- You need form builder chaining (`form()->...->submit()`) or conditional form steps.
- You need long-running interactive UX (`spin()`, `progress()`, `task()`, `stream()`) or terminal helpers (`title()`, `clear()`).
- You need prompt-specific testing expectations or fallback behavior details.

## Interactive Command Guidance
- Prefer `search()` / `multisearch()` over large static selects when options come from the database or are too numerous to scan.
- Prefer `autocomplete()` or `suggest()` when users benefit from completion but may still need freeform values.
- Prefer `form()` for grouped setup flows where users may need to revisit earlier answers (`CTRL + U` in supported terminals).
- Prefer `task()` for long-running work that benefits from a live log area, status messages, dynamic labels, or partial streamed output.
- Prefer `progress()` for bounded loops and `spin()` for single opaque operations.
- Assume unsupported environments and non-interactive runs still exist even when using Prompts; Laravel configures fallbacks automatically, but command behavior must remain safe and predictable.

## Testing And Fallbacks
- When prompt helpers produce informational output, assert it with prompt-aware expectations such as `expectsPromptsInfo()`, `expectsPromptsWarning()`, `expectsPromptsError()`, `expectsPromptsAlert()`, `expectsPromptsIntro()`, `expectsPromptsOutro()`, and `expectsPromptsTable()`.
- If a command has both interactive and non-interactive branches, test both paths.
- If reviewing custom prompt fallback behavior, prefer Laravel's built-in fallbacks unless the command genuinely needs `Prompt::fallbackWhen(...)` or prompt-class `fallbackUsing(...)` customization.

## Validation
Run at minimum:
```bash
./vendor/bin/pint <touched files>
./vendor/bin/pest --compact <relevant tests>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
# Laravel Prompts Reference

## Source And Scope

- Official Laravel 13 docs: <https://laravel.com/docs/13.x/prompts>
- Prompt helper signatures: <https://github.com/laravel/prompts/blob/main/src/helpers.php>
- Form builder signatures: <https://github.com/laravel/prompts/blob/main/src/FormBuilder.php>
- Prompt test expectations in Artisan tests: `vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php`
- Last synced: 2026-03-24

This reference is for authoring and reviewing interactive Artisan commands in Craft CMS.

## Import Patterns

Import only the helpers you use:

```php
use function Laravel\Prompts\confirm;
use function Laravel\Prompts\multiselect;
use function Laravel\Prompts\search;
use function Laravel\Prompts\text;
```

Or import many in one statement:

```php
use function Laravel\Prompts\{confirm, error, info, multiselect, search, text};
```

## Global Prompt Helpers

### Input Helpers

| Helper | Return | Key arguments | Notes |
| --- | --- | --- | --- |
| `text()` | `string` | `label`, `placeholder`, `default`, `required`, `validate`, `hint`, `transform` | Single line text input. |
| `textarea()` | `string` | `label`, `placeholder`, `default`, `required`, `validate`, `hint`, `rows`, `transform` | Multiline input. |
| `number()` | `int|string` | `label`, `placeholder`, `default`, `required`, `validate`, `hint`, `min`, `max`, `step` | Numeric input with arrow key adjustments. |
| `password()` | `string` | `label`, `placeholder`, `required`, `validate`, `hint`, `transform` | Input is masked. |
| `confirm()` | `bool` | `label`, `default`, `yes`, `no`, `required`, `validate`, `hint`, `transform` | Yes/no selection. |
| `select()` | `int|string` | `label`, `options`, `default`, `scroll`, `validate`, `hint`, `required`, `transform` | Single option from fixed list. |
| `multiselect()` | `array<int|string>` | `label`, `options`, `default`, `scroll`, `required`, `validate`, `hint`, `transform` | Multi option selection with space bar. |
| `suggest()` | `string` | `label`, `options` (array or closure), `placeholder`, `default`, `scroll`, `required`, `validate`, `hint`, `transform` | Autocomplete, freeform value still allowed. |
| `search()` | `int|string` | `label`, `options` (closure), `placeholder`, `scroll`, `validate`, `hint`, `required`, `transform` | Search first, then select one option. |
| `multisearch()` | `array<int|string>` | `label`, `options` (closure), `placeholder`, `scroll`, `required`, `validate`, `hint`, `transform` | Search first, then select multiple options. |
| `pause()` | `bool` | `message` | Waits for enter/return confirmation. |
| `autocomplete()` | `string` | `label`, `options` (array or closure), `placeholder`, `default`, `required`, `validate`, `hint` | Inline type-ahead completion via tab/right arrow. |

### Output And Utility Helpers

| Helper | Return | Purpose |
| --- | --- | --- |
| `info()` | `void` | Informational message. |
| `warning()` | `void` | Warning message. |
| `error()` | `void` | Error message. |
| `alert()` | `void` | Alert message. |
| `note()` | `void` | Generic note style. |
| `intro()` | `void` | Introductory message. |
| `outro()` | `void` | Closing message. |
| `table()` | `void` | Render rows and headers as a table. |
| `grid()` | `void` | Render items in a grid. |
| `spin()` | `mixed` | Spinner while callback executes; returns callback result. |
| `progress()` | `array|Progress` | Progress bar for iterable or fixed step count. |
| `task()` | `mixed` | Spinner + scrolling live log area for long-running work. |
| `stream()` | `Stream` | Stream incremental text into the terminal. |
| `title()` | `void` | Update the terminal window/tab title. |
| `clear()` | `void` | Clear terminal. |
| `form()` | `FormBuilder` | Build a multi-step prompt flow with backtracking. |

## Shared Argument Behavior

- `required`:
- `false` means optional.
- `true` enforces input.
- `string` enforces input with a custom message.
- `validate`:
- Closure returning `null` or an error message.
- For many text-like prompts, validation rule arrays are also accepted (for example `['name' => 'required|max:255']`).
- `transform`:
- Runs before validation.
- Use for normalization, such as `trim`, lowercase conversion, or casting.
- `hint`:
- Help text shown under the prompt.
- `scroll`:
- Visible option count before scrolling.
- `options` return value:
- Associative arrays return keys.
- Indexed arrays return values.

## Search Prompt Notes

- `search()` and `multisearch()` expect an `options` closure that receives current input and returns options.
- For value-based filtering, ensure the array is reindexed (`values()->all()` or `array_values(...)`) so it is not treated as associative.

## Form Builder Reference

Use `form()` when prompts are a sequence and users may need to go back (`CTRL + U` in supported terminals).

- `submit()` returns indexed responses unless prompt steps are given `name:`.
- Named steps return associative responses.
- Use `add(...)` when later prompts depend on earlier responses.
- `FormBuilder` also supports conditional chaining such as `when(...)` because it is conditionable.

### Core Methods

| Method | Purpose |
| --- | --- |
| `add(Closure $step, ?string $name = null, bool $ignoreWhenReverting = false)` | Add custom step closure. |
| `addIf(Closure|bool $condition, Closure $step, ?string $name = null, bool $ignoreWhenReverting = false)` | Add conditional custom step. |
| `submit(): array` | Execute steps and return responses. |

### Built-in Prompt Methods On `FormBuilder`

- `text(...)`
- `textarea(...)`
- `password(...)`
- `confirm(...)`
- `select(...)`
- `multiselect(...)`
- `suggest(...)`
- `search(...)`
- `multisearch(...)`
- `pause(...)`
- `spin(...)`
- `note(...)`
- `info(...)`
- `warning(...)`
- `error(...)`
- `alert(...)`
- `intro(...)`
- `outro(...)`
- `table(...)`
- `progress(...)`

Most form methods accept `name: 'key'` so `submit()` returns named responses.
For numeric input in a form flow, use `add(...)` and call `number(...)` inside the closure.

## Transform Before Validation

Use `transform` when users might include formatting you do not want to validate directly:

```php
$slug = text(
label: 'Slug',
transform: fn (string $value) => trim(strtolower($value)),
validate: ['slug' => 'required|alpha_dash']
);
```

## Informational Messages In Commands

Prefer one style per command path and keep message noise low:

- Prompt helpers for rich, prompt-themed messaging (`info()`, `warning()`, etc.).
- `$this->components->...` for conventional Artisan status output.

Use one approach intentionally and avoid mixing styles in every line unless there is a reason.

## Task And Stream Patterns

Use `task()` when a command should show live status while work is running.

- `task()` callback receives a logger.
- Logger methods include `line()`, `success()`, `warning()`, `error()`, `label()`, `partial()`, and `commitPartial()`.
- Use `limit:` to control how many scrolling log lines remain visible.
- `task()` and `spin()` animate when `ext-pcntl` is available; otherwise they degrade to static output.

Use `stream()` when output itself should arrive incrementally rather than as task log lines:

```php
use function Laravel\Prompts\stream;

$stream = stream();

foreach ($chunks as $chunk) {
$stream->append($chunk);
}

$stream->close();
```

Use `title()` for long-running commands where terminal/tab context helps, and reset with `title('')` when appropriate.

## Progress Patterns

Map-style progress:

```php
use function Laravel\Prompts\progress;

$results = progress(
label: 'Processing users',
steps: $users,
callback: fn ($user, $progress) => handleUser($user),
);
```

Manual progress:

```php
$progress = progress(label: 'Processing users', steps: count($users));
$progress->start();

foreach ($users as $user) {
handleUser($user);
$progress->advance();
}

$progress->finish();
```

## Fallbacks And Unsupported Environments

- Laravel Prompts supports macOS, Linux, and Windows under WSL.
- Laravel framework configures fallbacks automatically in unsupported environments.
- For non-Laravel or custom behavior:
- `Laravel\Prompts\Prompt::fallbackWhen(bool)`
- Per prompt class: `SomePrompt::fallbackUsing(Closure $fallback)`

## Terminal Constraints

- Keep labels/options/validation messages short enough for narrow terminals.
- A safe target is about 74 characters for 80-column terminals.
- Prompts with `scroll` automatically clamp to terminal height.

## Testing Prompt Output In Artisan Tests

Available prompt message assertions on `PendingCommand`:

- `expectsPromptsInfo(string $message)`
- `expectsPromptsWarning(string $message)`
- `expectsPromptsError(string $message)`
- `expectsPromptsAlert(string $message)`
- `expectsPromptsIntro(string $message)`
- `expectsPromptsOutro(string $message)`
- `expectsPromptsTable(array|Collection $headers, array|Collection|null $rows)`

## Craft Command Integration Pattern

Always gate prompts in case the command is running non-interactively:

```php
use function Laravel\Prompts\confirm;
use function Laravel\Prompts\text;

$name = $this->argument('name');

if (!$name) {
if (!$this->input->isInteractive()) {
$this->components->error('The name argument is required in non-interactive mode.');
return self::FAILURE;
}

$name = text(label: 'Name', required: true);
}

$shouldProceed = $this->input->isInteractive()
? confirm('Continue?', default: true)
: (bool)$this->option('force');
```
Loading
Loading