larapost / categories
There is no license information available for the latest version (v0.2) of this package.
Content categories system
v0.2
2019-05-01 15:05 UTC
This package is not auto-updated.
Last update: 2024-11-14 04:59:08 UTC
README
Install via composer
Add orm to composer.json configuration file.
$ composer require larapost/categories
add to file config/app.php
If you are using laravel version before 5.5 you must add our service provider.
'providers' => [ ... Larapost\Categorie\Support\ServiceProvider::class, ],
Migrate
you can use migrate
$ php artisan migrate
OR
$ php artisan migrate:fresh
Use
use Larapost\Categories;
functions
Add
function(Categories $categories) { return $categories->add('<name>', '<slug>' = false); }
Update
function(Categories $categories) { return $categories->update('<id>', '<name>', '<slug>' = false); }
Get
function(Categories $categories) { return $categories->get('<column>', '<value>', <subs> = true | false); }
Remove
function(Categories $categories) { return $categories->remove('<id>'); }
All
function(Categories $categories) { return $categories->all(); }
Sub categorie
Sub Add
function(Categories $categories) { return $categories->subAdd('<categorie_id>', '<name>', '<slug>' = false); }
Sub Update
function(Categories $categories) { return $categories->subUpdate('<id>', '<name>', '<slug>' = false); }
Sub Get
function(Categories $categories) { return $categories->subGet('<categorie_id>', '<column>', '<value>'); }
Sub Remove
function(Categories $categories) { return $categories->subRemove('<id>'); }
sub All
function(Categories $categories) { return $categories->subAll(); }