This commit is contained in:
deploy-bot committed 2026-12-04 11:54:45 +00:00
commit 1c8ad7dd6d
166 files changed
+11934

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
<?php
namespace IriksIT\Manager\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Shell;
use Symfony\Component\HttpFoundation\Response;
/**
* The screens are one page that asks the JSON routes for its data. A browser that opens a manager address gets that
* page; the page itself, and anything else that asks for JSON, gets the data. Downloads (route names `*.export`), the
* built files and the pictures of the tour are left alone.
*/
class ServeShell
{
public function handle(Request $request, Closure $next): Response
{
if (config('manager.ui') !== 'package' || ! $request->isMethodSafe() || $request->wantsJson() || $request->ajax()) {
return $next($request);
}
$name = (string) $request->route()?->getName();
if (in_array($name, [Names::route('assets'), Names::route('mascot')], true) || str_ends_with($name, '.export')) {
return $next($request);
}
return response()->view('manager::shell', app(Shell::class)->data($request));
}
}