torchlight-laravel icon indicating copy to clipboard operation
torchlight-laravel copied to clipboard

Add support for Livewire V3

Open Johannes-Werbrouck opened this issue 2 years ago • 2 comments

In Livewire V3 the response data looks different than livewire V2. Here are the differences:

Livewire V2: Scherm­afbeelding 2023-10-25 om 15 39 59

Livewire V3: Scherm­afbeelding 2023-10-25 om 15 38 52

This means data_get($data, 'effects.html') will return null if livewire V3 is being used. To enable both livewire versions, I'd suggest checking if null is returned and if so, loop over the components array . If not, I'd keep the original logic.

I have verified these changes work for one or multiple updating components with livewire V3.

Johannes-Werbrouck avatar Oct 25 '23 14:10 Johannes-Werbrouck

Hi!

I have the same problem and I confirm this fix works.

To try it, put this on your composer.json

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/Johannes-Werbrouck/torchlight-laravel"
        }
    ],

then

composer require torchlight/torchlight-laravel "dev-main"

SRWieZ avatar Nov 10 '23 15:11 SRWieZ

We should probably update https://github.com/torchlight-api/torchlight-laravel/blob/main/.github/workflows/tests.yml To have Livewire as a matrix too.

SRWieZ avatar Nov 10 '23 15:11 SRWieZ