PHP code example of propaganistas / laravel-fakeid

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

    

propaganistas / laravel-fakeid example snippets


use Illuminate\Database\Eloquent\Model;
use Propaganistas\LaravelFakeId\RoutesWithFakeIds;

class MyModel extends Model
{
    use RoutesWithFakeIds;
}

Route::get('articles/{article}', 'ArticleController@show')->name('articles.show');

use Illuminate\Database\Eloquent\Model;
use Propaganistas\LaravelFakeId\RoutesWithFakeIds;

class Article extends Model
{
    use RoutesWithFakeIds;
}

<a href="{{ route('articles.show', $article) }}"> {{ $article->name }} </a>
bash
    php artisan fakeid:setup