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 () {