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

Enhance Sortable Interface with Mass Update and Deletion Ordering Methods #182

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Faks
Copy link

@Faks Faks commented Nov 19, 2024

This pull request introduces enhancements to the Sortable interface in the spatie/eloquent-sortable package. Key changes include:

  1. PSR-12 Compliance: Updated the code to adhere to PSR-12 standards, ensuring consistency and readability throughout the package.
  2. Strict Types Declaration: Added declare(strict_types=1); to enforce strict typing and improve type safety.
  3. Mass Update Ordering Method: Added setMassNewOrder() method to support efficient reordering of multiple records at once, reducing overhead in batch operations.
  4. Support for Updating and Deleting: Added shouldSortWhenUpdating() and shouldSortWhenDeleting() methods to provide better control over model sorting behavior during updates and deletions.
  5. Namespace Correction: Fixed formatting issues in the namespace to align with the package's standards.

These changes improve flexibility and performance for users who need fine-grained control over the ordering behavior of their Eloquent models, particularly in large data sets or when reordering frequently.

2.) added: refactored views

Signed-off-by: Oskars Germovs <[email protected]>
2.) added: bugfix to bootSortableTrait is not set if not used in model as fallback

Signed-off-by: Oskars Germovs <[email protected]>
2.) added: bugfix and proper test coverage for deleting
3.) added: changes to config to avoid issues with old version package users

Signed-off-by: Oskars Germovs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant