Skip to content

Conversation

@chosten
Copy link
Contributor

@chosten chosten commented Jan 4, 2026

Description

Since #6208 model events are not triggered anymore when reordering table records. It is a problem when using Laravel Scout for example.
This PR adds a before and after reorder callback.

Same as #15055 because I needed it again for 4.x.

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

I'd need help for the documentation if it is required. English is not my primary language.

Sample usage

$table->reorderable('sequence', afterReorder: function (array $order): void {
    Item::whereIn('id', $order)->get()->each->searchable();
});

@danharrin danharrin added the enhancement New feature or request label Jan 4, 2026
@danharrin danharrin added this to the v4 milestone Jan 4, 2026
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Roadmap Jan 5, 2026
@danharrin danharrin merged commit fd001dc into filamentphp:4.x Jan 6, 2026
23 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Roadmap Jan 6, 2026
@chosten chosten deleted the add-reorder-hooks-4.x branch January 7, 2026 16:19
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

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants