<commit_before><?php namespace App\Providers;

use App\Bases\Providers\RouteServiceProvider as ServiceProvider;
use App\Http\Routes\ContactRoute;
use App\Http\Routes\PagesRoute;
use Illuminate\Routing\Router;

/**
 * Class     RouteServiceProvider
 *
 * @package  App\Providers
 * @author   ARCANEDEV <<EMAIL>>
 */
class RouteServiceProvider extends ServiceProvider
{
    /* ------------------------------------------------------------------------------------------------
     |  Properties
     | ------------------------------------------------------------------------------------------------
     */
    /**
     * This namespace is applied to the controller routes in your routes file.
     *
     * @var string
     */
    protected $namespace = 'App\\Http\\Controllers';

    /* ------------------------------------------------------------------------------------------------
     |  Main Functions
     | ------------------------------------------------------------------------------------------------
     */
    /**
     * Define the routes for the application.
     *
     * @param  Router  $router
     */
    public function map(Router $router)
    {
        $attributes = [
            'as'        => 'public::',
            'namespace' => $this->namespace,
        ];

        $router->group($attributes, function (Router $router) {
            (new PagesRoute)->map($router);
            (new ContactRoute)->map($router);

            require app_path('Http/routes.php');
        });
    }
}
<commit_msg>Adding the route pattern filters in RouteServiceProvider.<commit_after><?php namespace App\Providers;

use App\Bases\Providers\RouteServiceProvider as ServiceProvider;
use App\Http\Routes\ContactRoute;
use App\Http\Routes\PagesRoute;
use Illuminate\Routing\Router;

/**
 * Class     RouteServiceProvider
 *
 * @package  App\Providers
 * @author   ARCANEDEV <<EMAIL>>
 */
class RouteServiceProvider extends ServiceProvider
{
    /* ------------------------------------------------------------------------------------------------
     |  Properties
     | ------------------------------------------------------------------------------------------------
     */
    /**
     * This namespace is applied to the controller routes in your routes file.
     *
     * @var string
     */
    protected $namespace = 'App\\Http\\Controllers';

    /* ------------------------------------------------------------------------------------------------
     |  Main Functions
     | ------------------------------------------------------------------------------------------------
     */
    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @param  \Illuminate\Routing\Router  $router
     */
    public function boot(Router $router)
    {
        $this->definePatternFilters($router);

        parent::boot($router);
    }

    /**
     * Define the routes for the application.
     *
     * @param  \Illuminate\Routing\Router  $router
     */
    public function map(Router $router)
    {
        $attributes = [
            'as'        => 'public::',
            'namespace' => $this->namespace,
        ];

        $router->group($attributes, function (Router $router) {
            (new PagesRoute)->map($router);
            (new ContactRoute)->map($router);

            require app_path('Http/routes.php');
        });
    }

    /* ------------------------------------------------------------------------------------------------
     |  Other Functions
     | ------------------------------------------------------------------------------------------------
     */
    /**
     * Define route pattern filters.
     *
     * @param  Router  $router
     */
    private function definePatternFilters(Router $router)
    {
        $router->pattern('id',       '\d+');
        $router->pattern('hash',     '[a-z0-9]+');
        $router->pattern('uuid',     '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
        $router->pattern('base',     '[a-zA-Z0-9]+');
        $router->pattern('slug',     '[a-z0-9-]+');
        $router->pattern('token',    '[a-z0-9-]+');
    }
}

{'fraction_non_alphanumeric': 0.34754177767013805, 'fraction_numerical': 0.00581254541051102, 'mean_word_length': 1.0619071392910635, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 26, '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': '7304955', 'n_tokens_mistral': 968, 'n_tokens_neox': 973, 'n_words': 192}