balajidharma/laravel-category
最新稳定版本:v2.0.10
Composer 安装命令:
composer require balajidharma/laravel-category
包简介
Laravel nestable custom categories
README 文档
README
Create database-based Category to your Laravel projects.
Table of Contents
Installation
- Install the package via composer
composer require balajidharma/laravel-category
- Publish the migration and the config/category.php config file with
php artisan vendor:publish --provider="BalajiDharma\LaravelCategory\CategoryServiceProvider"
- Run the migrations
php artisan migrate
Demo
The "Basic Laravel Admin Penel" starter kit come with Laravel Category
Create Category Type
use BalajiDharma\LaravelCategory\Models\CategoryType; CategoryType::create([ 'name' => 'Product Category', 'machine_name' => 'product_category', 'description' => 'Site Product Category', ]);
Category Tree
- Get a category tree by using category type id
use BalajiDharma\LaravelCategory\Models\Category; $items = (new Category)->toTree($type->id);
- Get a category tree by using the category machine name
use BalajiDharma\LaravelCategory\Models\CategoryType; $items = CategoryType::getCategoryTree('product_category');
统计信息
- 总下载量: 10.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-16