定制 raymondidema/category 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

raymondidema/category

Composer 安装命令:

composer require raymondidema/category

包简介

Category table (POSTGRESQL ONLY)

README 文档

README

Category Table (Recursive) (PostgreSQL only)

Installation

 composer.json

 "require": {
	"laravel/framework": "4.1.*",
	"raymondidema/category": "dev-master"
},

After updating you could do composer update or composer install or alternatively composer require raymondidema/category

Config

 ./app/config/app.php
 
 'providers' => array( 'Raymondidema\Category\CategoryServiceProvider' );
 'aliases' => array( 'Menustructure' => 'Raymondidema\Category\Facades\Category' );

Children

 Menustructure::table('categories')
                ->children($id)
                ->depth(3)
                ->get();

Optional components

Required

table($table), children($id), childrenWithRoot($id), decendants($id), decendantsWithRoot($id), ancestors($id), breadcrumb($id), get(array('*'))

Optional

depth($integer), where($column, $option), orderBy($column, $ascOrDesc), remember($minutes = null)

Descendants

 Menustructure::table('categories')
                ->decendants($id)
                ->depth(2)
                ->where('name', 'aspire')
                ->get();

Ancestors

 Menustructure::table('categories')->ancestors($id)->get(array('name','slug'));

Database layout example

Category requires the following columns: id, parent_id, position

 Schema::create('categories', function(Blueprint $table)
 	{
 		$table->increments('id');
 		$table->integer('parent_id')->unsigned()->nullable();
 		$table->string('name');
 		$table->string('slug');
 		$table->integer('position')->unsigned()->nullable();
 		$table->timestamps();
 		$table->softDeletes();
 	});

How to interact with a model

this is not required.

 <?php

 use \Raymondidema\Category\Models\Reloquent;

 class Category extends Reloquent
 {
 	// do stuff here!!!
 }

统计信息

  • 总下载量: 40
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固