2021-07-30 18:38:43 +02:00
|
|
|
<?php
|
|
|
|
|
2021-09-07 13:37:18 +02:00
|
|
|
/** @noinspection UnusedFunctionResultInspection */
|
|
|
|
|
2021-11-10 17:20:20 +01:00
|
|
|
use App\Http\Controllers\SetupController;
|
2021-07-30 18:38:43 +02:00
|
|
|
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
|
|
|
|
2021-11-10 17:20:20 +01:00
|
|
|
// ----- PUBLIC ROUTES ----- //
|
2021-08-06 12:47:31 +02:00
|
|
|
Route::inertia('setup', 'SetupPage', [
|
2021-11-10 17:14:22 +01:00
|
|
|
'languages' => cache()->rememberForever('app.languages', fn () => array_map(
|
2021-08-06 12:47:31 +02:00
|
|
|
static fn ($file) => basename($file, '.json'),
|
2021-09-07 13:37:18 +02:00
|
|
|
glob(resource_path('lang').'/*.json', GLOB_NOSORT)
|
2021-11-10 17:14:22 +01:00
|
|
|
)),
|
|
|
|
'license' => cache()->rememberForever('app.license', fn () => file_get_contents(base_path('LICENSE'))),
|
2021-08-06 12:47:31 +02:00
|
|
|
]);
|
2021-11-10 18:41:25 +01:00
|
|
|
Route::options('setup/test', [SetupController::class, 'testDatabase'])->name('setup.test')->withoutMiddleware('csrf');
|
2021-08-03 19:17:43 +02:00
|
|
|
|
|
|
|
Route::get('lang/{language}', function ($language) {
|
|
|
|
app()->setLocale($language);
|
|
|
|
|
|
|
|
return redirect()->back();
|
2021-11-10 18:41:25 +01:00
|
|
|
})->name('app.language');
|