-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Description
Laravel Version
11.22
PHP Version
8.3.11
Database Driver & Version
No response
Description
All attributes are added when attributes merge is invoked
Steps To Reproduce
According to Laravel's documentation in https://laravel.com/docs/11.x/blade#default-merged-attributes, if the attributes in a blade component are set like this:
<div {{ $attributes->merge(['class' => 'alert alert-'.$type]) }}>
{{ $message }}
</div>
And then we invoke the component like this:
<x-alert type="error" :message="$message" class="mb-4"/>
The end result should be this:
<div class="alert alert-error mb-4">
<!-- Contents of the $message variable -->
</div>
But... That's not what I'm getting.
All attributes passed in the blade component are being added to the html element where I'm calling the attributes merge.
Please, check the following screenshot.
Am I doing something wrong or missing something?
Or is this a real issue?
Thanks in advance.
Regards.
