mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 21:41:06 +03:30
33 lines
988 B
PHP
Executable File
33 lines
988 B
PHP
Executable File
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Model>
|
|
*/
|
|
class PackageFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => $this->faker->word,
|
|
'note' => $this->faker->optional()->word,
|
|
'user_id' => User::factory(), // ایجاد کاربر به طور خودکار
|
|
'bar_code' => $this->faker->optional()->word,
|
|
'qr_code' => $this->faker->optional()->word,
|
|
'creator_id' => User::factory(), // ایجاد کاربر دیگر به عنوان creator
|
|
'status' => $this->faker->randomElement(['approved', 'rejected', 'suspended']),
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
];
|
|
}
|
|
}
|