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
]
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.