2021-07-30 18:38:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Web Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-07-30 22:56:43 +02:00
|
|
|
Route::redirect('/', 'setup');
|
2021-08-03 19:43:16 +02:00
|
|
|
|
|
|
|
// ----- INERTIA ROUTES ----- //
|
2021-08-06 12:47:31 +02:00
|
|
|
Route::inertia('setup', 'SetupPage', [
|
|
|
|
'languages' => array_map(
|
|
|
|
static fn ($file) => basename($file, '.json'),
|
|
|
|
glob(resource_path('lang').'/*.json')
|
|
|
|
),
|
|
|
|
'license' => file_get_contents(base_path('LICENSE')),
|
2021-09-07 13:28:20 +02:00
|
|
|
'title' => __('Configurazione'),
|
2021-08-06 12:47:31 +02:00
|
|
|
]);
|
2021-08-03 19:17:43 +02:00
|
|
|
|
|
|
|
Route::get('lang/{language}', function ($language) {
|
|
|
|
app()->setLocale($language);
|
|
|
|
|
|
|
|
return redirect()->back();
|
|
|
|
})->name('language');
|