claudiodekker / inertia-laravel-testing

Testing helpers for https://github.com/inertiajs/inertia-laravel
MIT License
134 stars 6 forks source link

`where` assertion: Automatically cast arrays to Collection instances #13

Closed claudiodekker closed 3 years ago

claudiodekker commented 3 years ago

This would make use-cases like these slightly simpler to work with, by removing the need to manually make this cast:

$inertia->where('month.dates', function ($dates) {
    return collect($dates)
        ->where('date', '2018-06-02')
        ->where(...);

Before doing this we should look into making sure this doesn't cause any issues. I believe Inertia already converts things before we run assertions on it, but I'm not 100% sure of this from the top of my head. If it does, then this should be a very simple (breaking?) change to make.