From a394e0ff18f23979080c54f86855e93b587d5302 Mon Sep 17 00:00:00 2001 From: boban Date: Sat, 16 May 2026 08:12:54 +0200 Subject: [PATCH] fix(bio): add BioPageFactory, newFactory() override on BioPage --- app/Domains/Bio/Models/BioPage.php | 5 +++++ database/factories/BioPageFactory.php | 29 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 database/factories/BioPageFactory.php diff --git a/app/Domains/Bio/Models/BioPage.php b/app/Domains/Bio/Models/BioPage.php index 15500c5..a0cd8c5 100644 --- a/app/Domains/Bio/Models/BioPage.php +++ b/app/Domains/Bio/Models/BioPage.php @@ -22,6 +22,11 @@ class BioPage extends Model 'ulid' => 'string', ]; + protected static function newFactory(): \Database\Factories\BioPageFactory + { + return \Database\Factories\BioPageFactory::new(); + } + protected static function booted(): void { static::creating(function (self $model) { diff --git a/database/factories/BioPageFactory.php b/database/factories/BioPageFactory.php new file mode 100644 index 0000000..0eac570 --- /dev/null +++ b/database/factories/BioPageFactory.php @@ -0,0 +1,29 @@ +create(); + $workspace = (new \App\Domains\Workspace\Actions\CreateWorkspace)->handle($user, ['name' => 'Test']); + + return [ + 'workspace_id' => $workspace->id, + 'slug' => Str::slug(fake()->words(2, true)), + 'title' => ['en' => fake()->sentence(4), 'de' => fake()->sentence(4)], + 'description' => ['en' => fake()->sentence(), 'de' => fake()->sentence()], + 'theme' => [], + 'is_published' => true, + ]; + } +}