Current state

This commit is contained in:
2026-02-07 08:23:18 +01:00
commit 0a4372c40d
22479 changed files with 1553543 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace Database\Factories;
use App\Models\Artwork;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class ArtworkFactory extends Factory
{
protected $model = Artwork::class;
public function definition(): array
{
$title = $this->faker->unique()->sentence(3);
return [
'user_id' => User::factory(),
'title' => $title,
'slug' => Str::slug($title) . '-' . $this->faker->unique()->randomNumber(5),
'description' => $this->faker->paragraph(),
'file_name' => 'image.jpg',
'file_path' => 'uploads/artworks/image.jpg',
'file_size' => 12345,
'mime_type' => 'image/jpeg',
'width' => 800,
'height' => 600,
'is_public' => true,
'is_approved' => true,
'published_at' => now()->subDay(),
];
}
public function unpublished(): self
{
return $this->state(fn () => ['published_at' => null]);
}
public function private(): self
{
return $this->state(fn () => ['is_public' => false]);
}
public function unapproved(): self
{
return $this->state(fn () => ['is_approved' => false]);
}
}