Add built-in screens (login, profile, menu, posts), per-user and site themes
This commit is contained in:
1 parent
4bf0a8bbb0
commit
351667abaf
46 files changed
+3720
-12
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace IriksIT\Manager\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
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`) and the
|
||||
* built files 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 ($name === 'manager.assets' || str_ends_with($name, '.export')) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
return response()->view('manager::shell', app(Shell::class)->data($request));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user