<?php

namespace App\Filament\Resources\Pages;

use App\Services\Audit\SuperAdminAuditLogger;
use Filament\Resources\Pages\CreateRecord;

class AuditedCreateRecord extends CreateRecord
{
    protected function afterCreate(): void
    {
        app(SuperAdminAuditLogger::class)->recordModelMutation(
            'created',
            $this->record,
            SuperAdminAuditLogger::fieldsMetadata($this->form->getState()),
            static::class
        );
    }
}
