Download the PHP package novius/laravel-nova-order-nestedset-field without Composer
On this page you can find all versions of the php package novius/laravel-nova-order-nestedset-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-nova-order-nestedset-field
Nova Order Field nestedset
A field that make your resources orderable using the laravel nestedset package.
Requirements
- PHP >= 8.1
- Laravel Nova >= 4.0
NOTE: These instructions are for Laravel Nova 4.0. If you are using prior version, please see the previous version's docs.
Installation
Configuration
Some options that you can override are available.
Usage
Step 1
Use Kalnoy\Nestedset NodeTrait
and Novius\LaravelNovaOrderNestedsetField Orderable
trait on your model.
Example :
Step 2
Add the field to your resource and specify order for your resources.
Scoping
Imagine you have Menu
model and MenuItems
. There is a one-to-many relationship
set up between these models. MenuItem
has menu_id
attribute for joining models
together. MenuItem
incorporates nested sets. It is obvious that you would want to
process each tree separately based on menu_id
attribute. In order to do so, you
need to specify this attribute as scope attribute:
Retrieve more information about usage on official doc.
Performances
You can enable cache to avoid performance issues in case of large tree.
By default cache is disabled.
To use cache you have to enabled it in config file with :
You have to clear cache on every tree updates with an observer on your Model (or directly in boot method).
Override default languages files
Run:
Lint
Run php-cs with:
Contributing
Contributions are welcome! Leave an issue on Github, or create a Pull Request.
Licence
This package is under GNU Affero General Public License v3 or (at your option) any later version.
All versions of laravel-nova-order-nestedset-field with dependencies
laravel/nova Version ^5.0
laravel/framework Version ^10.0 | ^11.0 | ^12.0
kalnoy/nestedset Version ^6.0.0