actengage/sluggable
最新稳定版本:v6.1.1
Composer 安装命令:
composer require actengage/sluggable
包简介
A simple trait to ensure Laravel models have slugs.
关键字:
README 文档
README
A simple package for managing "slugs" to Eloquent models. Sluggable is a trait for Eloquent models to ensure a slug exists for the model, and saved it in a column
Installation
composer require actengage/sluggable
Implementation
To implement Sluggable, you just need to assign the Sluggable trait to the
model.
namespace App\Page;
use Actenage\Sluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
class Page extends Model {
use Sluggable;
protected $fillable = [
'title', 'slug'
];
}
Basic Example
$page = Page::create([
'title' => 'This is some title'
]);
dd($page->slug); // 'this-is-some-page-title'
统计信息
- 总下载量: 1.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-07