<?php
    $newUrl = route($url);
    $params = [];
    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)) {
        $newUrl .= (str_contains($newUrl, '?') ? '&' : '?') . http_build_query($params);
    }
?>
<button class="mobile-btn-atualizar btn btn-lg btn-primary d-inline" onclick="window.location.href='<?php echo e($newUrl); ?>'">
    <i class="fa-solid fa-plus"></i> <?php echo e($text); ?>

</button>
<?php /**PATH /var/www/html/portal/resources/views/components/buttons/_newButton.blade.php ENDPATH**/ ?>