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, + ]; + } +}