<?php

namespace App\Filament\Resources\Monitoring\MediaMonitorings;

use App\Filament\Resources\Monitoring\MediaMonitorings\Pages\CreateMediaMonitoring;
use App\Filament\Resources\Monitoring\MediaMonitorings\Pages\EditMediaMonitoring;
use App\Filament\Resources\Monitoring\MediaMonitorings\Pages\ListMediaMonitorings;
use App\Filament\Resources\Monitoring\MediaMonitorings\Schemas\MediaMonitoringForm;
use App\Filament\Resources\Monitoring\MediaMonitorings\Tables\MediaMonitoringsTable;
use App\Models\MediaMonitoring;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use UnitEnum;

class MediaMonitoringResource extends Resource
{
    protected static ?string $model = MediaMonitoring::class;

    protected static string|UnitEnum|null $navigationGroup = 'Monitoring';

    protected static string|BackedEnum|null $navigationIcon = Heroicon::ClipboardDocumentCheck;

    protected static ?string $navigationLabel = 'Monitoring Media';

    protected static ?int $navigationSort = 1;

    protected static ?string $recordTitleAttribute = 'code';

    protected static ?string $slug = 'monitoring/media-monitorings';

    public static function form(Schema $schema): Schema
    {
        return MediaMonitoringForm::configure($schema);
    }

    public static function table(Table $table): Table
    {
        return MediaMonitoringsTable::configure($table);
    }

    public static function getPages(): array
    {
        return [
            'index' => ListMediaMonitorings::route('/'),
            'create' => CreateMediaMonitoring::route('/create'),
            'edit' => EditMediaMonitoring::route('/{record}/edit'),
        ];
    }

    public static function getRecordRouteBindingEloquentQuery(): Builder
    {
        return parent::getRecordRouteBindingEloquentQuery()
            ->withoutGlobalScopes([
                SoftDeletingScope::class,
            ]);
    }
}
