Download the PHP package arniro/laravel-sluggable without Composer
On this page you can find all versions of the php package arniro/laravel-sluggable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arniro/laravel-sluggable
More information about arniro/laravel-sluggable
Files in arniro/laravel-sluggable
Package laravel-sluggable
Short Description A package to generate a slug for Laravel models. Translatable columns are also supported.
License MIT
Homepage https://github.com/arniro/laravel-sluggable
Informations about the package laravel-sluggable
Generate a slug for your Eloquent models
Installation
Install the package via composer:
composer require arniro/laravel-sluggable
Usage
Include a Sluggable
trait to the model:
Whenever you create or update a model, a slug will be generated from the name
column to the slug
column by default.
A slug
column will be filled with the following value: lorem-ipsum
. The slug value will always be unique.
You can override a column name that is used to generate a slug from with the getSluggable
method:
Translatable columns
If your column is translatable and you use
a spatie/laravel-translatable package
it will be recognized and used behind the scenes so all you need to do is to add your
slug column name to the translatable
property of your model:
So now if you're creating or updating a sluggable column, all of its locales will be slugged:
Testing
License
The MIT License (MIT). Please see License File for more information.