Closed imacrayon closed 4 years ago
This:
@include('partials/fields/input', [ 'label' => __('Name'), 'name' => 'name', 'value' => old('name', $tag->name), 'class' => 'mt-6', 'attributes' => [ 'required' => true ], ])
Becomes:
<x-text :label="__('Name')" name="name" :value="old('name', $tag->name)" required />
Cleaner form markup!
Laravel 7 blade components live in resources/views/components, the component tag begins with <x-filename .... Attributes work just like HTML attributes. Prefixing an attribute with a : will allow you to use a PHP expression in the attribute's value.
resources/views/components
<x-filename ...
:
This:
Becomes:
Cleaner form markup!
Laravel 7 blade components live in
resources/views/components
, the component tag begins with<x-filename ...
. Attributes work just like HTML attributes. Prefixing an attribute with a:
will allow you to use a PHP expression in the attribute's value.