tighten / parental

Use single table inheritance in your Laravel app
MIT License
1.36k stars 98 forks source link

Bugfix: Collection Serlization error when using parental #123

Closed Smoggert closed 9 months ago

Smoggert commented 9 months ago

I attempted fixing a long time ago but taytay decided to change the name of the function last minute when merging the PR. As a result this bug is still alive and kicking due to implementing a useless function.

This PR renames said function to the one taytay chose, and as a result it actually works.

To test:

/**
         * Implements: Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
         */
        SomeJob::dispatch(
        /**
         * Implements: HasChildren
         */
            SomeParentModelWithChildren::query()->get()
        );

        // queued job fails critically as it cannot deserialize the collection

After the change the job should correctly serliaze the models and be able to run.

driftingly commented 9 months ago

Thanks @Smoggert 🙌