scripthost/routes/web.php
Javier Feliz 74f5dc5db1
Some checks failed
tests / ci (push) Has been cancelled
linter / quality (push) Has been cancelled
Build & Push Docker Image to Registry / build (release) Failing after 3m7s
Initial test
2025-07-22 19:45:33 -04:00

38 lines
1.1 KiB
PHP

<?php
use App\Livewire\Settings\Appearance;
use App\Livewire\Settings\Password;
use App\Livewire\Settings\Profile;
use App\Models\Script;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome');
})->name('home');
Route::view('dashboard', 'dashboard')
->middleware(['auth', 'verified'])
->name('dashboard');
Route::middleware(['auth'])->group(function () {
Route::redirect('settings', 'settings/profile');
Route::get('settings/profile', Profile::class)->name('settings.profile');
Route::get('settings/password', Password::class)->name('settings.password');
Route::get('settings/appearance', Appearance::class)->name('settings.appearance');
});
require __DIR__ . '/auth.php';
Route::get("{path}.sh", function (string $path) {
$script = Script::where('path', $path)->firstOrFail();
return response($script->content, 200)->header('Content-Type', 'text/plain');
})->name('script-content');
Route::get("{path}", function (string $path) {
$script = Script::where('path', $path)->firstOrFail();
return view('script', compact('script'));
})->name('script-view');