isStaticAsset($path)) { abort(404); } if ($path !== '' && $path !== 'index.html') { $hashUrl = '/admin/#/'.$path; $query = request()->getQueryString(); if (is_string($query) && $query !== '') { $hashUrl .= '?'.$query; } return redirect($hashUrl); } return response()->file($index, ['Content-Type' => 'text/html; charset=UTF-8']); } protected function isStaticAsset(string $path): bool { if (str_starts_with($path, 'assets/')) { return true; } return (bool) preg_match('/\.(?:js|css|png|jpe?g|gif|svg|ico|woff2?|ttf|map|webp)$/i', $path); } }