PHP code example of duyduc-nguyen / laravel-sluggable-trait

1. Go to this page and download the library: Download duyduc-nguyen/laravel-sluggable-trait library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

duyduc-nguyen / laravel-sluggable-trait example snippets


 namespace App;

use Illuminate\Database\Eloquent\Model;
use DuyDucNguyen\Database\Traits\SluggableTrait;

class Item extends Model {

	use SluggableTrait;

}

 namespace App;

use Illuminate\Database\Eloquent\Model;
use DuyDucNguyen\Database\Traits\SluggableTrait;

class Item extends Model {

	use Sluggable;

	const SLUGGABLE_COLUMN = 'title';
	const SLUG = 'slug';

}


const ENABLE_SLUG_CACHE = true;