rajurayhan/laravel-eloquent-order-manager

A Laravel package for effortlessly managing the order of Eloquent models. Simplify sorting, reordering, and maintaining the order of items in your application with ease.

dev-master 2024-03-01 11:35 UTC

This package is auto-updated.

Last update: 2024-04-30 11:59:16 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A Laravel package for effortlessly managing the order of Eloquent models. Simplify sorting, reordering, and maintaining the order of items in your application with ease.

Installation

You can install the package via composer:

composer require rajurayhan/laravel-eloquent-order-manager


## Usage 
  
    use Raju\EloquentOrder\EloquentOrderManagerService;

    $orderManager = new EloquentOrderManagerService(YourModel::class);
    $newItem = ["name" => "New Item", "order" => 4];
    $newItem = ["id" => 5, "name" => "New Item", "order" => 4]; // If Updating existing entry.
    $orderManager->addOrUpdateItem($newItem);
 
## Find Me
	Email: devraju.bd@gmail.com