Route::group([
'as' => 'server.',
'prefix' => '/{address}:{port}',
'where' => [
'address' => '^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$', // Сопоставление доменов, субдоменов и IP-адресов
'port' => '^[0-9]+$',
],
], function () {
Route::get('/', [ServerController::class, 'index'])->name('index');
});
Route::get('/{address}:{port}', [ServerController::class, 'index'])->where([
'address' => '^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$',
'port' => '^[0-9]+$',
]);