PHP code example of drobee / nova-sluggable

1. Go to this page and download the library: Download drobee/nova-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/ */

    

drobee / nova-sluggable example snippets


use Drobee\NovaSluggable\SluggableText;
use Drobee\NovaSluggable\Slug;

class User extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            SluggableText::make('Title'),
            Slug::make('Slug'),

            // ...
        ];
    }
}

SluggableText::make('Title')->slug('SEO Title');
Slug::make('SEO Title', 'slug');

Slug::make('Slug')->slugLanguage('hu');

Slug::make('Slug')->slugMaxLength(100);

Slug::make('Slug')->slugSeparator('.');

Slug::make('Slug')->event('blur');

Slug::make('Slug')
    ->slugUnique()
    ->slugModel(static::$model);