You've already forked Atomcms-edit
574b5d6e17
feat: add 24 model factories for Help, Shop, Community, Game, User domains - Translate mixed Dutch/English strings in README.md and AlertSettings.php - Add HasFactory trait to 23 models - Create factories for Help (6), Shop (4), Community (5), Game (2), User (7)
40 lines
986 B
PHP
Executable File
40 lines
986 B
PHP
Executable File
<?php
|
|
|
|
namespace Database\Factories\Community\Staff;
|
|
|
|
use App\Models\Community\Staff\WebsiteStaffApplications;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class WebsiteStaffApplicationsFactory extends Factory
|
|
{
|
|
protected $model = WebsiteStaffApplications::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'rank_id' => 1,
|
|
'content' => $this->faker->paragraphs(3, true),
|
|
];
|
|
}
|
|
|
|
public function approved(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'status' => 'approved',
|
|
'approved_by' => User::factory(),
|
|
'approved_at' => now(),
|
|
]);
|
|
}
|
|
|
|
public function rejected(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'status' => 'rejected',
|
|
'rejected_by' => User::factory(),
|
|
'rejected_at' => now(),
|
|
]);
|
|
}
|
|
}
|