awcodes / filament-addons

A set of components / fields to extend Filament Admin.
30 stars 3 forks source link

OEmbed Component Error #15

Closed abbasmashaddy72 closed 8 months ago

abbasmashaddy72 commented 8 months ago

Bug Fix: OEmbed Component Throws Error

Issue: When attempting to use the OEmbed component to enter a YouTube URL, the following error is thrown:

FilamentAddons\Forms\Components\OEmbed::FilamentAddons\Forms\Components\{closure}(): Argument #1 ($set) must be of type Closure, Filament\Forms\Set given, called in /home/abbasmashaddy72/Documents/Sites/Dynamic/cms/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35

Resolution: To resolve this issue, I made the following changes to the code:

Old Code (Line No: 30):

->afterStateUpdated(function(Closure $set, Closure $get, $state) use ($field) {

Updated Code:

->afterStateUpdated(function (Set $set, Get $get, $state) use ($field) {

After making this change, the issue was resolved, and the OEmbed component worked as expected.

Thanks to the FilamentAddons package for its valuable contributions in enhancing Filament's admin panel functionality! 👏🎉

I am adding a Pull Request for the Same, I would appreciate it if accepted.

abbasmashaddy72 commented 8 months ago

Will be fixed with #16