<?php
// app/Helpers/AuthHelper.php

if (!function_exists('can')) {
    function can($permission)
    {
        return auth()->check() && auth()->user()->hasPermission($permission);
    }
}

if (!function_exists('hasRole')) {
    function hasRole($role)
    {
        return auth()->check() && auth()->user()->hasRole($role);
    }
}

if (!function_exists('isAdmin')) {
    function isAdmin()
    {
        return auth()->check() && auth()->user()->hasRole('admin');
    }
}

if (!function_exists('isSuperAdmin')) {
    function isSuperAdmin()
    {
        return auth()->check() && auth()->user()->isSuperAdmin();
    }
}
