All rules

Sheath rule

statamic-fluent-required-parameters

Executed literal Statamic fluent calls must provide the parameters required by their core tag and method.
Package
Statamic
Category
Blade
Default severity
error by default
Auto-fix
Manual fix

#Why

An executed fluent call can reach Statamic without an input that its tag needs. The resulting failure or empty output otherwise appears only when the view is rendered.

#Examples

#Bad

{{-- vite:asset is executed without its required src parameter. --}}
{{ Statamic::tag('vite:asset')->fetch() }}

#Good

{{-- Each form supplies the required src parameter. --}}
{{ Statamic::tag('vite:asset')->src('resources/js/app.js') }}
{{ Statamic::tag('vite:asset')->param('src', 'resources/js/app.js') }}
{{ Statamic::tag('vite:asset')->params(['src' => 'resources/js/app.js']) }}

#Notes

The final concrete write to a parameter wins. A later dynamic map or dynamic parameter name makes the affected result unknown, while a later concrete write can make it knowable again.

Dynamic tag names, values, and maps are skipped when runtime state could supply the input. Builders that are never consumed are also skipped. Requirements are limited to Statamic 6 core tags and do not infer add-on contracts.

#See Also

Equivalent rules cover the other literal invocation forms: