jonassiewertsen / statamic-livewire

A Laravel Livewire integration for Statamics antlers engine
83 stars 14 forks source link

Mounted parameters get augmented #25

Closed FR6 closed 1 year ago

FR6 commented 1 year ago

Is this the desired effect that when passing an Statamic\Entries\Entry parameter it gets augmented?

On vendor/jonassiewertsen/statamic-livewire/src/Tags/Livewire.php: $parameters->toArray() will convert the Entry to an augmented array. If we replace ->toArray() with ->all() the Entry stays an object.

image

Here is the output from Ray from line #43:

image

Let me know if it's a bug and you want me to PR.

jonassiewertsen commented 1 year ago

This is indeed by purpose, as this was the only way it did work without problems at the time of the addon creation. Which has been a while ago.

Your statement is correct, that parameters will be passed as an array. What is the bug? What is the problem with this approach? Is there any trouble you running into?

If can take another look, if you can provide more context, as I don't think to understand the problem correctly.

FR6 commented 1 year ago

Ok no problem, I was just curious if it was really what was expected.

Thank you!