mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-12 20:20:41 -05:00
42 lines
1005 B
PHP
42 lines
1005 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\License;
|
|
use App\Models\Mod;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class ModFactory extends Factory
|
|
{
|
|
protected $model = Mod::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$name = $this->faker->words(3, true);
|
|
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'name' => $name,
|
|
'slug' => Str::slug($name),
|
|
'description' => $this->faker->paragraph,
|
|
'license_id' => License::factory(),
|
|
'source_code_link' => $this->faker->url(),
|
|
'contains_ai_content' => $this->faker->boolean,
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Indicate that the mod should be soft-deleted.
|
|
*/
|
|
public function deleted(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'deleted_at' => now(),
|
|
]);
|
|
}
|
|
}
|