36 lines
1,011 B
PHP
36 lines
1,011 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Certification;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class CertificationFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Certification::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
$name = $this->faker->unique()->words((int)$this->faker->randomFloat(0, 5, 6), true);
|
|
|
|
return [
|
|
'name' => $name,
|
|
'status' => $this->faker->boolean(70),
|
|
'sticker' => new \SplFileInfo(\resource_path(
|
|
'../database/factories/assets/certifications/cert-sample.png'
|
|
)),
|
|
'sticker_alt' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 5, 6), true),
|
|
'sticker_title' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 2, 4), true),
|
|
];
|
|
}
|
|
}
|