<?php

namespace App\Filament\Resources\SopTemplateResource\Pages;

use App\Filament\Resources\SopTemplateResource;
use Filament\Resources\Pages\CreateRecord;

class CreateSopTemplate extends CreateRecord
{
    protected static string $resource = SopTemplateResource::class;

    protected function mutateFormDataBeforeCreate(array $data): array
    {
        $data['created_by'] = auth()->id();
        
        return $data;
    }

    protected function getRedirectUrl(): string
    {
        return $this->getResource()::getUrl('edit', ['record' => $this->getRecord()]);
    }
}
