PHP code example of intothesource / laravel-slugable

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

    

intothesource / laravel-slugable example snippets




namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Intothesource\Slugable\Slugable;

class Page extends Model
{
    use Slugable;
    
    ...

'This is a title' => 'this-is-a-title'

'This is a title' => 'this-is-a-title-2'

'This is my post number 20' => 'this-is-my-post-number-20'

'This is my post number 20' => 'this-is-my-post-number-20-2'