PHP code example of mr-timofey / eloquent-sluggable

1. Go to this page and download the library: Download mr-timofey/eloquent-sluggable 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/ */

    

mr-timofey / eloquent-sluggable example snippets


class MyModel extends \Illuminate\Database\Eloquent\Model {
	use \MrTimofey\EloquentSluggable\Sluggable;

	/**
	 * @var string attribute name that used as a source for transliteration
	 */
	protected static $slugSource = 'name';

	/**
	 * @var string attribute name containing a slug itself
	 */
	protected static $slugField = 'slug';

	/**
	 * @var bool slug can be null
	 */
	protected static $slugNullable = false;
}