for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Eddy <[email protected]>
*/
namespace App\Model\Admin;
class Category extends Model
{
protected $guarded = [];
public static $searchField = [
'name' => '名称',
];
public static $listField = [
'parentName' => '上级分类',
'entityName' => '关联模型',
'order' => '排序',
public function parent()
return $this->belongsTo('App\Model\Admin\Category', 'pid');
}
public function children()
return $this->hasMany('App\Model\Admin\Category', 'pid');
public function entity()
return $this->belongsTo('App\Model\Admin\Entity', 'model_id');