mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
833 B
PHP
34 lines
833 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Xmen\StarterKit\StarterKitFacade;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Product>
|
|
*/
|
|
class ProductFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition()
|
|
{
|
|
|
|
$rand = rand(1,2);
|
|
$title = ($rand == 1?'موبایل':'تبلت').' ' . $this->faker->unique()->firstNameFemale;
|
|
return [
|
|
//
|
|
'name' => $title,
|
|
'slug' => StarterKitFacade::slug($title),
|
|
'excerpt' => $this->faker->realText(150),
|
|
'user_id' => 1,
|
|
'cat_id' => $rand,
|
|
'description' => $this->faker->realText(600),
|
|
];
|
|
}
|
|
}
|