Skip to content

Commit

Permalink
Merge pull request #40 from rahmanramsi/3.x
Browse files Browse the repository at this point in the history
Allow globally configure dehydrateStateUsing
  • Loading branch information
coolsam726 authored Mar 21, 2024
2 parents c1a7487 + e6ec35a commit 3974977
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Forms/Components/Flatpickr.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,12 @@ protected function setUp(): void
'
);
$this->theme(config('coolsam-flatpickr.default_theme', FlatpickrTheme::DEFAULT));
$this->dehydrateStateUsing(static function (Flatpickr $component, $state) {
return self::dehydratePickerState($component, $state);
});

if(! $this->dehydrateStateUsing){
$this->dehydrateStateUsing(static function (Flatpickr $component, $state) {
return self::dehydratePickerState($component, $state);
});
}

/*$this->rule(
'date',
Expand Down

0 comments on commit 3974977

Please sign in to comment.