<?php

namespace App\Filament\Loggers;

use App\Models\Permission;
use App\Filament\Resources\PermissionResource;
use Illuminate\Contracts\Support\Htmlable;
use Noxo\FilamentActivityLog\Loggers\Logger;
use Noxo\FilamentActivityLog\ResourceLogger\Field;
use Noxo\FilamentActivityLog\ResourceLogger\RelationManager;
use Noxo\FilamentActivityLog\ResourceLogger\ResourceLogger;

class PermissionLogger extends Logger
{
    public static ?string $model = Permission::class;

    public static function getLabel(): string | Htmlable | null
    {
        return PermissionResource::getModelLabel();
    }

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('name')->label(__('Name')),
                Field::make('guard_name')->label(__('Guard Name')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
