All rules

Sheath rule

native-model-modifier

NativePHP model directives must use a literal property name and supported synchronization modifiers.
Package
NativePHP
Category
Native
Default severity
error by default
Auto-fix
Manual fix

#Why

Unsupported model syntax can prevent binding or silently select a different synchronization mode.

#Examples

#Bad

{{-- The modifier typo, legacy modifier, and dynamic property are unsupported. --}}
<native:text-input native:model.debonce.500ms="query" />
<native:text-input @model.debounce.300ms="query" />
<native:text-input :native:model="$property" />

#Good

{{-- Both bindings use literal properties and supported modifiers. --}}
<native:text-input native:model.debounce.500ms="query" />
<native:text-input native:model.blur="query" />

#Supported Modifiers

native:model accepts live, blur, lazy, debounce, and debounce.<milliseconds>ms. A timed debounce must be greater than zero.

Legacy @model accepts no modifiers. The rule suggests the corresponding native:model spelling when a modifier is used.

#Syntax

The value must be a literal PHP property name without dots. Assignments must be quoted and cannot contain whitespace around =.

Only the final effective model binding is checked. A later valid binding can replace an earlier invalid modifier.

#Options

All NativePHP rules accept nativeViewPaths. The default is ['views/native/']. See Native View Detection for path configuration.

#See Also

Related rules validate the target and property: