Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Listify

Laravel Listify Laravel Package

czim/laravel-listify

Laravel package to manage ordered lists for Eloquent models. Provides helpers for positioning records, moving items up/down, reordering, and maintaining consistent sort indexes within groups/scopes. Useful for sortable menus, playlists, and drag-and-drop UIs.

View on GitHub
Deep Wiki
Context7

Re-take on the popular Listify package by Lookitsatravis

Frequently asked questions about Laravel Listify
How do I install czim/laravel-listify in my Laravel project?
Run `composer require czim/laravel-listify` in your project directory. The package requires Laravel 8+ and PHP 8.0+. No additional configuration is needed unless you’re using custom database columns or relationships.
Can I use this package for nested lists (e.g., categories with subcategories)?
No, this package is designed for flat, ordered lists only. For nested hierarchies, consider alternatives like `spatie/laravel-nestedset` or implement a custom solution with Eloquent relationships.
Does Laravel Listify support drag-and-drop reordering out of the box?
No, the package provides backend logic for reordering via API endpoints, but you’ll need to integrate a frontend library like SortableJS, Vue Draggable, or Livewire’s sortable components to enable drag-and-drop.
What Laravel versions does czim/laravel-listify support?
The package is officially tested for Laravel 8+. For Laravel 9 or 10, verify compatibility with Eloquent changes, but no major breaking updates are expected since it relies on core Laravel features.
How do I handle concurrent reordering requests (race conditions)?
Wrap reordering operations in database transactions to prevent race conditions. The package doesn’t enforce this by default, so you’ll need to manually add `DB::transaction()` around your reorder logic or API calls.
Can I use this package with Livewire or Inertia.js for real-time updates?
Yes, Livewire or Inertia.js can consume the package’s API endpoints for reordering. For real-time updates, pair it with Laravel Echo and broadcasting (e.g., Pusher) to push changes to connected clients.
What database columns are required for Listify to work?
Your parent model (e.g., `Playlist`) needs a `listify()` relationship pointing to a model with an `order` column (integer). Example: `public function songs() { return $this->hasMany(ListItem::class); }`.
Is there a way to add custom validation or authorization for list reordering?
Yes, you can extend the package using policies or model events. For example, create a `ListItemPolicy` to gate reordering actions or override the `ListItemReordered` event to add custom logic.
How do I migrate an existing list system to use Laravel Listify?
Start by adding the `order` column to your list items table if missing. Replace custom reordering logic with Listify’s traits and methods. Test incrementally with a non-critical list before full migration.
Are there performance concerns with large lists (e.g., 10,000+ items)?
For very large lists, ensure your `order` column is indexed. Consider caching frequently accessed lists or implementing pagination. If performance degrades, evaluate database sharding or alternative architectures.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity