<?php

namespace App\Filament\Resources\ApplynowInfoResource\Pages;

use App\Filament\Resources\ApplynowInfoResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Gate;
class EditApplynowInfo extends EditRecord
{
    protected static string $resource = ApplynowInfoResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\DeleteAction::make()
                ->before(function () {
                    // Add any pre-delete logic here
                })
                ->visible(fn () => Gate::allows('delete applynowinfo')),
            Actions\ForceDeleteAction::make()
                ->visible(fn () => Gate::allows('force delete applynowinfo')),
            Actions\RestoreAction::make()
                ->visible(fn () => Gate::allows('restore applynowinfo')),
        ];
    }

    protected function getRedirectUrl(): string
    {
        return $this->getResource()::getUrl('index');
    }

    protected function getSavedNotification(): ?Notification
    {
        return Notification::make()
            ->success()
            ->title('Apply Now Info updated')
            ->body('The Apply Now information has been updated successfully.');
    }

    protected function mutateFormDataBeforeSave(array $data): array
    {
        // Add any data transformation logic here
        return $data;
    }
} 