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

Return an HTML search screen from /search for browser visits and point the bottom nav Search tab at it instead of the dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 15:38:29 +00:00
co-authored by Cursor
parent cf9d7cc75d
commit b7b9e5ef05
6 changed files with 162 additions and 10 deletions
@@ -9,19 +9,22 @@ use App\Models\HostingAccountMember;
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,
]);
}