Closed devajmeireles closed 3 months ago
11.9.2
8.2.19
N/A
As we know, Blade offers us convenient attributes as HTML-related directives:
The problem is that when we try to pass these attributes to a Blade component, the directive compiles successfully, but the component does not:
Considering the Laravel Breeze text-input component:
text-input
<x-app-layout> <x-slot name="header"> <h2 class="font-semibold text-xl text-gray-800 leading-tight"> {{ __('Dashboard') }} </h2> </x-slot> <x-text-input label="Name" @required(true) /> <div class="py-12"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg"> <div class="p-6 text-gray-900"> {{ __("You're logged in!") }} </div> </div> </div> </div> </x-app-layout>
Note: In the above example, we only wrote <x-text-input label="Name" @required(true) /> in the middle of the file.
<x-text-input label="Name" @required(true) />
dashboard.blade.php
This isn't supported unfortunately: https://laravel.com/docs/11.x/blade#component-attributes
Laravel Version
11.9.2
PHP Version
8.2.19
Database Driver & Version
N/A
Description
As we know, Blade offers us convenient attributes as HTML-related directives:
The problem is that when we try to pass these attributes to a Blade component, the directive compiles successfully, but the component does not:
Considering the Laravel Breeze
text-input
component:Note: In the above example, we only wrote
<x-text-input label="Name" @required(true) />
in the middle of the file.Steps To Reproduce
dashboard.blade.php
<x-text-input label="Name" @required(true) />