12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
58
database/factories/PressReleaseFactory.php
Normal file
58
database/factories/PressReleaseFactory.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\Portal;
|
||||
use App\Enums\PressReleaseStatus;
|
||||
use App\Models\Category;
|
||||
use App\Models\Company;
|
||||
use App\Models\PressRelease;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<PressRelease>
|
||||
*/
|
||||
class PressReleaseFactory extends Factory
|
||||
{
|
||||
protected $model = PressRelease::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$title = fake()->sentence(6);
|
||||
|
||||
return [
|
||||
'uuid' => (string) Str::uuid(),
|
||||
'portal' => fake()->randomElement([Portal::Presseecho->value, Portal::Businessportal24->value]),
|
||||
'user_id' => User::factory(),
|
||||
'company_id' => Company::factory(),
|
||||
'category_id' => Category::factory(),
|
||||
'language' => 'de',
|
||||
'title' => $title,
|
||||
'slug' => Str::slug($title).'-'.fake()->unique()->numberBetween(1000, 9999),
|
||||
'text' => fake()->paragraphs(3, true),
|
||||
'status' => PressReleaseStatus::Draft->value,
|
||||
'hits' => 0,
|
||||
'no_export' => false,
|
||||
];
|
||||
}
|
||||
|
||||
public function published(): static
|
||||
{
|
||||
return $this->state([
|
||||
'status' => PressReleaseStatus::Published->value,
|
||||
'published_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function inReview(): static
|
||||
{
|
||||
return $this->state(['status' => PressReleaseStatus::Review->value]);
|
||||
}
|
||||
|
||||
public function forPortal(Portal $portal): static
|
||||
{
|
||||
return $this->state(['portal' => $portal->value]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue