<commit_before><?php

declare(strict_types=1);

namespace Cortex\Foundation\Overrides\Lord\Laroute\Routes;

use Illuminate\Routing\Route;
use Lord\Laroute\Routes\Collection as BaseCollection;

class Collection extends BaseCollection
{
    /**
     * Get the route information for a given route.
     *
     * @param $route     \Illuminate\Routing\Route
     * @param $filter    string
     * @param $namespace string
     *
     * @return array
     */
    protected function getRouteInformation(Route $route, $filter, $namespace)
    {
        $uri = $route->uri();
        $name = $route->getName();
        $laroute = array_get($route->getAction(), 'laroute', null);

        switch ($filter) {
            case 'all':
                if ($laroute === false) {
                    return;
                }
                break;
            case 'only':
                if ($laroute !== true) {
                    return;
                }
                break;
        }

        return compact('uri', 'name');
    }
}<commit_msg>Add host to the JS route generation<commit_after><?php

declare(strict_types=1);

namespace Cortex\Foundation\Overrides\Lord\Laroute\Routes;

use Illuminate\Routing\Route;
use Lord\Laroute\Routes\Collection as BaseCollection;

class Collection extends BaseCollection
{
    /**
     * Get the route information for a given route.
     *
     * @param $route     \Illuminate\Routing\Route
     * @param $filter    string
     * @param $namespace string
     *
     * @return array
     */
    protected function getRouteInformation(Route $route, $filter, $namespace)
    {
        $uri = $route->uri();
        $host = $route->domain();
        $name = $route->getName();
        $laroute = array_get($route->getAction(), 'laroute', null);

        switch ($filter) {
            case 'all':
                if ($laroute === false) {
                    return;
                }
                break;
            case 'only':
                if ($laroute !== true) {
                    return;
                }
                break;
        }

        return compact('host', 'uri', 'name');
    }
}
{'fraction_non_alphanumeric': 0.12207670720299345, 'fraction_numerical': 0.0009354536950420954, 'mean_word_length': 1.7075949367088608, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5993661', 'n_tokens_mistral': 594, 'n_tokens_neox': 580, 'n_words': 141}