area17 / blast

Storybook for Laravel Blade 🚀
https://dev.to/area17/getting-started-with-blast-storybook-for-laravel-blade-c5c
Apache License 2.0
268 stars 39 forks source link

Ability to pass args to story as an array? #33

Closed RobertByrnes closed 1 year ago

RobertByrnes commented 2 years ago

Hi @mrtimbrook is this supported and I am missing something? I have been so far able to pass an array to the story so it registers in the controls addon effectively but only gets passed to the components blade as a bool?

mrtimbrook commented 2 years ago

Hi. Yep, arrays are supported. Can you send over an example of one that's causing you an issue?

Does this work for you?

@storybook([
    'args' => [
        'testArray' => [
            'item1', 'item2', 'item3'
        ]
    ]
])

@foreach ($testArray as $item)
    <p>{{ $item }}</p>
@endforeach
RobertByrnes commented 2 years ago

Will do...cheers