ldc-doux/database/factories/ProductFactory.php
2021-12-22 17:32:05 +01:00

33 lines
895 B
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use SplFileInfo;
class ProductFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$name = $this->faker->text(10) . rand(1, 100);
return [
'name' => $name,
'slug' => Str::slug($name),
'description' => $this->faker->paragraph(),
'picture' => new SplFileInfo(resource_path('assets/images/product_sample_01.png')),
'alt_text_picture' => $this->faker->sentence(10),
'is_published' => true,
'is_on_top' => false,
'is_food_service' => false,
'seo_title' => $this->faker->text(5),
'seo_description' => $this->faker->sentence(20),
];
}
}