<?php if(isset($permission) && auth()->user()->getPermissaoDetalhes($permission)['editar']): ?>
    <?php
        $editUrl = route($route, $id);
        $params = [];
        if (!empty($queryParams)) {
            $params = $queryParams;
        } else {
            if (request()->filled('q')) {
                $params['q'] = request()->input('q');
            }
            if (request()->filled('page')) {
                $params['page'] = request()->input('page');
            }
        }
        $params['return_url'] = url()->full();
        if (!empty($params)) {
            $editUrl .= (str_contains($editUrl, '?') ? '&' : '?') . http_build_query($params);
        }
    ?>
    <a href="<?php echo e($editUrl); ?>" class="btn btn-sm btn-warning" title="<?php echo e($title); ?>">
        <?php if($fontawesome == null): ?>
            <i class="fa-solid fa-pen-to-square"></i>
        <?php else: ?>
            <?php echo $fontawesome; ?>

        <?php endif; ?>
    </a>
<?php endif; ?>
<?php /**PATH /var/www/html/portal/resources/views/components/buttons/_editButton.blade.php ENDPATH**/ ?>