-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing $attributes to component slot does not work #52082
Comments
Assalamu Alaikum Brother @KhizarWahabKhan, I hope you're doing well. Could you please create a new Laravel project and reproduce the issue you're facing with some demo component slots? Once you have done this, kindly share the GitHub repository with us so we can focus on solving the error without needing to repeat these steps. Thank you, and I look forward to your cooperation. |
@KhizarWahabKhan see this issue there is a solution and why is it like this answer is #34313 (comment) |
Hey there, While this may be a legitimate issue, can you first try posting your problem or question on one of the support channels below? If this issue can be definitively identified as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out. Thanks! |
Ok i will check the links. Thanks @lmottasin and @crynobone. |
Laravel Version
11
PHP Version
8.3.1
Database Driver & Version
Mysql
Description
Component slots can accept attributes but throws the following error when when passed all attributes through $attribute variable:
Illuminate\View\ComponentSlot::withAttributes(): Argument #1 ($attributes) must be of type array, null given,
Steps To Reproduce
This works when attributes are given manually the x-title:slot:
But this does not work, here the attribute bag is passed to the x-slot:title with default classes. It works on the main component x-alert but does not work on the slot:
The text was updated successfully, but these errors were encountered: