I'm using the blade component system with Laravel 8.
I'm currently getting a lot of parameters to pass to a component. So I'm searching a way to pass parameters (or attributes) from the blade template into the component class constructor with the spread operator.
So :
<x-mycmp regularA="something" regularB="somethingelse" custom="test" />
To be understood by :
public function __construct ($regularA, $regularB, ...$addidionnalVars)
{
// ...
}
Where the "custom" attribute will be in the $addidionnalVars array.
For now, I got a "laravel Unresolvable dependency resolving [Parameter #2 [ ...$addidionnalVars]] in class" error.
Is there a way to make this works ?