Add a mobile search page for Servers.
Deploy Ladill Servers / deploy (push) Successful in 29s

Return an HTML search screen from /search for browser visits so the bottom nav Search tab opens a usable lookup UI instead of raw JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 15:38:38 +00:00
co-authored by Cursor
parent b40d8e50b4
commit fc58c9d40d
5 changed files with 160 additions and 8 deletions
@@ -7,19 +7,22 @@ use App\Models\CustomerHostingOrder;
use App\Models\HostingProduct;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
class SearchController extends Controller
{
public function __invoke(Request $request): JsonResponse
public function __invoke(Request $request): JsonResponse|View
{
$q = trim((string) $request->query('q', ''));
$results = mb_strlen($q) >= 2 ? $this->resultsForUser($request->user(), $q) : [];
if (mb_strlen($q) < 2) {
return response()->json(['results' => []]);
if ($request->expectsJson() || $request->ajax() || $request->wantsJson()) {
return response()->json(['results' => $results]);
}
return response()->json([
'results' => $this->resultsForUser($request->user(), $q),
return view('search', [
'query' => $q,
'results' => $results,
]);
}