Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add HasLifecycleHooks for CanUpdateState #9495

Merged
merged 4 commits into from
Nov 9, 2023
Merged

Conversation

noxoua
Copy link
Contributor

@noxoua noxoua commented Nov 6, 2023

  • Changes have been thoroughly tested to not break existing functionality.
  • New functionality has been documented or existing documentation has been updated to reflect changes.

Added HasLifecycleHooks for CanUpdateState.

This allows you to add hooks before and after for the following columns:

  • CheckboxColumn
  • SelectColumn
  • TextInputColumn
  • ToggleColumn

Example:

TextInputColumn::make()
    ->beforeStateUpdated(function ($record, $state) {
        // Runs before the state is saved to the database.
    })
    ->afterStateUpdated(function ($record, $state) {
        // Runs after the state is saved to the database.
    })

@danharrin danharrin added the enhancement New feature or request label Nov 8, 2023
@danharrin danharrin added this to the v3 milestone Nov 8, 2023
@noxoua noxoua requested a review from danharrin November 8, 2023 15:24
@noxoua noxoua mentioned this pull request Nov 9, 2023
12 tasks
@danharrin danharrin merged commit 0ba5a3b into filamentphp:3.x Nov 9, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants