<?php

namespace App\Policies;

use App\Models\NavItem;
use App\Models\User;

class NavItemPolicy
{
    public function manage(User $user): bool
    {
        $roles = $user->roles()->pluck('roles.name')->map(fn ($name) => strtolower((string) $name))->toArray();
        return in_array('admin', $roles, true) || in_array('administrator', $roles, true);
    }
}
