awcodes / filament-curator

A media picker plugin for Filament Panels.
MIT License
343 stars 89 forks source link

Revert "Support for collections & MorphOne polymorphic pivot table" #529

Closed awcodes closed 3 months ago

awcodes commented 3 months ago

Reverts awcodes/filament-curator#523

get_class() breaks if $ids is an array of integers instead of array of media items. Line 25 in helpers.php

if (is_array($ids) && is_related_to_media_through_pivot(get_class(current($ids)), Media::class)) {
    $mediaIds = collect($ids)->map(fn ($model) => $model?->media_id)->toArray();

    return Media::whereIn('id', $mediaIds)->get();
}