title: Pass attributes / props as array
body: <p>I want to use an array and use it to fill the props of a laravel-blade (8.x) component dynamically. In short something like that: <br /></p>
  <p><code>&lt;x-button size=&quot;sm&quot; {{ $buttonProps }} /&gt;</code> where <code>$buttonProps</code> is an array with key-value pairs defining the props and its values for the button to render. <br /></p>
  <p>The array would look like this: <code>['label' =&gt; 'My Button', 'size' =&gt; 'sm', ...]</code>
  <br>
  <br></p>
  <p>Here is a more in detail example of what I try to do:</p>
  <h5>1. Button component with some props</h5>
  <pre class="lang-html prettyprint-override"><code>@props([
    'size' =&gt; 'md', # sm, md, lg
    'variant' =&gt; 'basic', # basic, success, error
    'label' =&gt; '',
  ])
  
  @php
    // ... 
  @endphp
  
  &lt;button {{ $attributes-&gt;merge([ 'class' =&gt; '...' ]) }}&gt;
    {!! $label !!}
  &lt;/button&gt;
  </code></pre>
  <h5>2. ButtonGroup - which will render the Buttons using an array for their props</h5>
  <p>Here is the thing which doesn't work: <code>{{ $buttonProps }}</code>. I want to dynamically pass down the props for the Button as an array. But this solution doesn't work like that of course. Is there a solution how I can do that?</p>
  <pre class="lang-html prettyprint-override"><code>@props([
    'buttons' =&gt; []
  ])
  
  &lt;div class=&quot;...&quot;&gt;
    @foreach ($buttons as $buttonProps)
      &lt;x-button size=&quot;sm&quot; {{ $buttonProps }} /&gt;
    @endforeach
  &lt;/div&gt;
  </code></pre>
  <h5>3. Finally how I would use the ButtonGroup in this scenario</h5>
  <p>You may notice that I pass some extra prop to the first button. That's basically why I need a dynamic approach as I don't know all the props passed in my real-life scenario.</p>
  <pre><code>&lt;x-button-group
      :buttons=&quot;[
          [
              'label' =&gt; 'Export',
              'hello' =&gt; 'world',
              'type' =&gt; 'button',
              'onclick' =&gt; '() =&gt; alert(\'hello world\')',
          ],
          [
              'label' =&gt; 'Main action',
              'variant' =&gt; 'accent',
          ]
      ]&quot;
  /&gt;
  </code></pre>
  <p>Note: I know I could easily make this example running using slots here, but my real-life example is a little different in requirements. I used Button and ButtonGroup as an example to illustrate my problem.</p>