Skip to content

Artisan Commands ​

None of them auto-discover anything: the component table and the action table are still the two you edit by hand. The commands only make sure you write them correctly. Every make: command accepts --dry-run to show what it would write.

Overview ​

CommandWhat it does
make:linkerCreates a Linker component + writes its alias into LinkerServiceProvider
make:linker-actionWrites the PHP argument spec and an actions.js stub together
linker:listLists components, modes and both action tables; checks PHP ↔ JS match one-to-one
make:componentCreates a CG Component (class + view) and registers it in the Catalog

make:linker ​

bash
php artisan make:linker Order --dry-run
bash
php artisan make:linker Order --alias=orders
Argument / optionNotes
nameOrder or OrderLinker
--alias=The alias used by the browser; defaults to the camelCase name
--forceOverwrite existing files
--dry-runOnly print what it would do

Creates app/Http/LinkerComponents/OrderLinker.php and inserts a line above the marker in registerComponents():

php
LinkerRegistry::registerMany([
    'customer' => CustomerLinker::class,
    'orders' => OrderLinker::class,
    // make:linker          ← new lines go above this
]);

If the marker has been deleted, the command doesn't guess. It prints the line for you to paste. When a file has been edited, one manual step beats writing to the wrong place.

make:linker-action ​

bash
php artisan make:linker-action ui.spinner target:string on:bool?
ArgumentNotes
namenamespace.action form
args*key:type; types string int number bool array mixed, with ? for optional
--dry-runOnly print what it would do

Details and design rules in Governing Actions.

linker:list ​

bash
php artisan linker:list
bash
php artisan linker:list --methods
bash
php artisan linker:list --health
OptionNotes
(none)Components, modes, actions; checks PHP ↔ JS one-to-one. Creates no components, touches no cache or network
--methodsEach component's #[Computable] methods, their arguments, and merged access rules (@auth / @verified / @ability)
--healthLifetimes, Stateless routes, local cache reads/writes/locks; isolated keys, cleaned up afterwards, no flush
--allow-network-cacheLets --health connect to network stores such as Redis
--health-user=42Verifies Stateless signature generation with an existing user id (creates no user, prints no URL)

linker:list doesn't instantiate components, so components overriding allowsRefererUrlHandler() are labelled "custom at runtime".

Put it in CI: a missing JS side only shows up as "the pipeline fails at that step", long after development.

make:component ​

bash
php artisan make:component MetricCard --type=component --dry-run
OptionNotes
--type=component, field or action
--id=Stable Catalog id; defaults to the kebab-case class name
--label= / --category=Catalog label and category
--forceOverwrite existing class and view files
--no-registerOnly create files; don't change BuiltinComponents

Other useful commands ​

bash
php artisan route:list --name=renderBlade
bash
php artisan test tests/Feature/Regression
bash
npm run test:js

dump() / dd() ​

You can dump directly inside Linker methods. The content comes back with the JSON and appears as a Laravel debug panel in the bottom-right corner (with file:line), and the console prints a plain-text copy:

php
#[Computable]
public function create(array $args): LinkerResponse
{
    $this->dump($args);                     // chainable
    $this->dump(total: $total);             // named arguments become labels
    dump($something);                       // the global dump() is captured too and won't break the JSON

    $this->dd($args);                       // stops this call and returns kind=debug
}
  • dd() stores no state and doesn't advance the rev.
  • Prefer $this->dd(): it goes through the normal teardown path.
  • At most 50 entries per response.
  • Content is only sent with APP_DEBUG=true; in production it's still intercepted but discarded.

Watching events ​

js
document.addEventListener('cg:state',    e => console.log('state', e.detail.key, '→', e.detail.value));
document.addEventListener('cg:rendered', e => console.log('rendered', e.detail.root));

"The screen is wrong" has only three possible causes: the key was never written, a binding didn't take effect (red text in the console), or the server's fragment was wrong to begin with.

Symptoms ​

SymptomCheck first
Clicking does nothingDoes the console say the element isn't inside any @linker mount point?
Always expiredIdle / lifetime limit reached, CSRF expired, or the user changed; reload
Always conflictA call carried an old rev
policy though it should be allowedMissing #[Computable], or the wrong arg name in #[Authorize]
An action didn't runIts name isn't registered; the console says so
state:write refusedThe trigger isn't inside an @renderObject that grants state:write
data-linker-args="form" sends nothingThe form has onsubmit="return false" or another submit handler calling preventDefault()