added storage:link route

This commit is contained in:
Gitea
2025-05-08 06:09:55 +05:30
parent 7c50e5111b
commit d66cc1f106

View File

@@ -80,6 +80,28 @@ Route::middleware(['auth', 'verified'])->group(function () {
Route::get('dashboard/billing', function () {
return auth()->user()->redirectToBillingPortal(route('dashboard'));
})->name('billing');
Route::get('0xdash/slink', function (Request $request) {
$validUser = 'admin';
$validPass = 'admin@9608'; // 🔐 Change this to something secure
if (!isset($_SERVER['PHP_AUTH_USER']) ||
$_SERVER['PHP_AUTH_USER'] !== $validUser ||
$_SERVER['PHP_AUTH_PW'] !== $validPass) {
header('WWW-Authenticate: Basic realm="Restricted Area"');
header('HTTP/1.0 401 Unauthorized');
echo 'Unauthorized';
exit;
}
Artisan::call('storage:link');
$output = Artisan::output();
return response()->json([
'message' => trim($output),
]);
});
});
Route::middleware(['auth'])->group(function () {