<?php

namespace App\Filament\Resources\AlertMailRuleResource\Pages;

use App\Filament\Resources\AlertMailRuleResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditAlertMailRule extends EditRecord
{
    protected static string $resource = AlertMailRuleResource::class;

    protected function mutateFormDataBeforeSave(array $data): array
    {
         //dd('test');
        if ($data['is_active']) {
            $data['plant'] = 0;
        }
        return $data;
    }

    protected function getHeaderActions(): array
    {
        return [
            Actions\ViewAction::make(),
            Actions\DeleteAction::make(),
            Actions\ForceDeleteAction::make(),
            Actions\RestoreAction::make(),
        ];
    }
}
