<commit_before><?php

namespace App\Providers;

use App\Models\Page;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Models\Definitions\Block as BlockDefinition;
use App\Models\Definitions\Layout as LayoutDefinition;
use App\Models\Definitions\Region as RegionDefinition;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
	/**
	 * This namespace is applied to your controller routes.
	 *
	 * In addition, it is set as the URL generator's root namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'App\Http\Controllers';

	/**
	 * Define your route model bindings, pattern filters, etc.
	 *
	 * @return void
	 */
	public function boot()
	{
		parent::boot();

	    Route::bind('page', function($value){
	        return Page::where('id', '=', $value)->firstOrFail();
	    });

	    Route::bind('block_definition', function($value){
	        $path = BlockDefinition::locateDefinitionOrFail($value, request()->get('version', null));
	        return BlockDefinition::fromDefinitionFile($path);
	    });

	    Route::bind('layout_definition', function($value){<commit_msg>Tell Laravel what its root URL is to avoid wrongly redirecting due to proxies of something...<commit_after><?php

namespace App\Providers;

use App\Models\Page;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Models\Definitions\Block as BlockDefinition;
use App\Models\Definitions\Layout as LayoutDefinition;
use App\Models\Definitions\Region as RegionDefinition;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
	/**
	 * This namespace is applied to your controller routes.
	 *
	 * In addition, it is set as the URL generator's root namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'App\Http\Controllers';

	/**
	 * Define your route model bindings, pattern filters, etc.
	 *
	 * @return void
	 */
	public function boot()
	{
		parent::boot();

        /** @var \Illuminate\Routing\UrlGenerator $url */
        $url = $this->app['url'];
        // Force the application URL
        $url->forceRootUrl(config('app.url'));

	    Route::bind('page', function($value){
	        return Page::where('id', '=', $value)->firstOrFail();
	    });

	    Route::bind('block_definition', function($value){
	        $path = BlockDefinition::locateDefinitionOrFail($value, request()->get('version', null));
	        return BlockDefinition::fromDefinitionFile($path);
	    });

	    Route::bind('layout_definition', function($value){
{'fraction_non_alphanumeric': 0.13064944929737943, 'fraction_numerical': 0.0, 'mean_word_length': 4.14453125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5548517', 'n_tokens_mistral': 746, 'n_tokens_neox': 705, 'n_words': 188}