Download the PHP package veiliglanceren/laravel-morph-categories without Composer
On this page you can find all versions of the php package veiliglanceren/laravel-morph-categories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download veiliglanceren/laravel-morph-categories
More information about veiliglanceren/laravel-morph-categories
Files in veiliglanceren/laravel-morph-categories
Package laravel-morph-categories
Short Description A Laravel package to support polymorphic category relationships for any model.
License MIT
Homepage https://github.com/veiliglanceren-nl/laravel-morph-categories
Informations about the package laravel-morph-categories
Laravel Morph Category
A Laravel package to add polymorphic category support to any model. Easily attach, detach, sync, and query categories using elegant Eloquent relationships.
๐ Installation
Requirements
| Package version | PHP | Laravel |
|---|---|---|
| 3.x | 8.2 or newer | 12.x, 13.x |
| 2.x | 8.1 or newer | 10.x, 11.x, 12.x |
Upgrading to 3.0
Version 3.0 drops support for Laravel 10 and 11 and PHP 8.1, and adds support for Laravel 13. There are no API changes. If you are still on Laravel 10 or 11, stay on ^2.0.
๐ฆ Usage
1. Add Trait to Your Model
2. Attach, Detach & Sync Categories
You can also use slugs or IDs:
โ Use Cases
- Rename tables if you already use
categoriesfor something else. - Replace the model class with your own
CategoryorCategoryableimplementation.
โ๏ธ Configuration
You can publish and customize the config file:
This will create a file at config/category.php with the following structure:
๐ Relationships
๐ Query Scoping
You can query models with specific categories:
๐งช Testing
This package uses Pest and Orchestra Testbench:
Or manually:
๐ License
The MIT License (MIT). Please see License File for more information.
๐ค Author
Developed and maintained by Niels Hamelink at VeiligLanceren.nl.
All versions of laravel-morph-categories with dependencies
spatie/laravel-sluggable Version ^3.0|^4.0
laravel/framework Version ^12.0|^13.0
ext-dom Version *
ext-simplexml Version *