PHP code example of laravelista / illaoi

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

    

laravelista / illaoi example snippets


'providers' => [
    ...
    Laravelista\Illaoi\IllaoiServiceProvider::class
];

'aliases' => [
    ...
    'Illaoi' => Laravelista\Illaoi\Facades\Illaoi::class
];

Illaoi::generate('This is a post')

// returns: this-is-a-post

Illaoi::generateUnique('This is a post', new App\Post);

// returns: this-is-a-post

$post = App\Post::create([
    'id' => 1,
    'title' => 'This is a post,
    'seo_slug' => 'this-is-a-post'
]);

Illaoi::searchBy('seo_slug')
    ->ignoreId(1)
    ->generateUnique('This is a post', new App\Post);

// returns: this-is-a-post

Illaoi::generateUnique('This is a post', new App\Post);

// returns: this-is-a-post-2

Illaoi::setIteration(1)->generateUnique('This is a post', new App\Post);

// returns: this-is-a-post-1