PHP code example of unisys12 / fake-canine

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

    

unisys12 / fake-canine example snippets




namespace Vendor\YourProject;

use Unisys12\FakeCanine\FakeCanineProvider;
use Faker\Generator;

class CanineModelFactory
{
    $fakeCanine = new FakeCanineProvider((new Generator));

    return [
        'name' => $fakeCanine->name(),
        'breed' => $fakeCanine->breed(),
        'gender' => $fakeCanine->gender
    ]
}

namespace Database\Factories;

use App\Models\Canine;
use Unisys12\FakeCanine\FakeCanineProvider;

class CanineFactory extends Factory
{
    protected $model = Canine::class;

    public function definition()
    {
        $fakeCanine = new FakeCanineProvider($this->faker);

        return [
            'name' => $fakeCanine->name(),
            'breed' => $fakeCanine->breed(),
            'gender' => $fakeCanine->gender
         ]
    }
}