<?php

declare(strict_types=1);

namespace App\Filament\Resources\SpaCourses\Pages;

use App\Filament\Resources\SpaCourses\SpaCourseResource;
use App\Models\SpaCourse;
use App\Support\Filament\Slugging\GeneratesDailySequenceSlug;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;

class CreateSpaCourse extends CreateRecord
{
    use GeneratesDailySequenceSlug;

    protected static string $resource = SpaCourseResource::class;

    protected function handleRecordCreation(array $data): Model
    {
        return $this->createRecordWithDailySequenceSlug(SpaCourse::class, $data, 'slug');
    }
}
