静态资源

This commit is contained in:
2020-09-16 08:35:46 +08:00
parent 24315e4798
commit ac3b53b163
40 changed files with 8270 additions and 660 deletions

View File

@@ -7,17 +7,22 @@ use Encore\Admin\Traits\ModelTree;
class Category extends Model
{
use AdminBuilder, ModelTree;
public const TYPES = [
'article' => '文章列表',
'show' => '文章详情',
'advert' => '广告',
];
public const TYPE_SHOW = 'show';
public const TYPE_SHOW = 'show';
public const TYPE_ARTICLE = 'article';
public const TYPE_ADVERT = 'advert';
public const TYPES = [
self::TYPE_ARTICLE => '文章列表',
self::TYPE_SHOW => '文章详情',
self::TYPE_ADVERT => '图片',
];
public function getLinkAttribute()
{
return route('category.show', $this);
}
/**
* 关联的数据
@@ -42,12 +47,12 @@ class Category extends Model
public function childrens()
{
return $this->hasMany(self::class,'parent_id');
return $this->hasMany(self::class, 'parent_id');
}
public function parent()
{
return $this->hasOne(self::class,'id','parent_id');
return $this->hasOne(self::class, 'id', 'parent_id');
}
public function article()