From d66cc1f1063d902abb8e147060e913620fc5164a Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 8 May 2025 06:09:55 +0530 Subject: [PATCH] added storage:link route --- routes/web.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/routes/web.php b/routes/web.php index 05753d4..566d735 100644 --- a/routes/web.php +++ b/routes/web.php @@ -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 () {