PHP code example of innoge / filament-form-faker
1. Go to this page and download the library: Download innoge/filament-form-faker 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/ */
innoge / filament-form-faker example snippets
namespace App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource;
use Filament\Resources\Pages\CreateRecord;
use InnoGE\FilamentFormFaker\Traits\FillsFormWithFakeData;
class CreateUser extends CreateRecord
{
use FillsFormWithFakeData;
protected static string $resource = UserResource::class;
}
protected function shouldFillFormWithFakeData(): bool
{
// insert your custom logic here
}
public function mount()
{
$this->getForm('form')->fake();
// or
$this->form->fake();
}