openstamanager/routes/web.php

36 lines
1.2 KiB
PHP
Raw Normal View History

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