optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -11,9 +11,9 @@ use Illuminate\Support\Str;
final class ArtworkDraftService
{
public function createDraft(int $userId, string $title, ?string $description, ?int $categoryId = null): ArtworkDraftResult
public function createDraft(int $userId, string $title, ?string $description, ?int $categoryId = null, bool $isMature = false): ArtworkDraftResult
{
return DB::transaction(function () use ($userId, $title, $description, $categoryId) {
return DB::transaction(function () use ($userId, $title, $description, $categoryId, $isMature) {
$slug = $this->uniqueSlug($title);
$artwork = Artwork::create([
@@ -28,8 +28,11 @@ final class ArtworkDraftService
'width' => 1,
'height' => 1,
'is_public' => false,
'visibility' => Artwork::VISIBILITY_PRIVATE,
'is_approved' => false,
'is_mature' => $isMature,
'published_at' => null,
'artwork_status' => 'draft',
]);
// Attach the selected category to the artwork pivot table