承接 actengage/sluggable 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-07