setLimit($limit); if (!is_null($request->get('q')) && strlen($request->get('q')) >= $minSearchLen) { $query = trim(strtolower($request->get('q'))); $words = explode(' ', $query); $subTitle = trans('firefly.search_results_for', ['query' => $query]); $transactions = $searcher->searchTransactions($words); $accounts = $searcher->searchAccounts($words); $categories = $searcher->searchCategories($words); $budgets = $searcher->searchBudgets($words); $tags = $searcher->searchTags($words); $result = ['transactions' => $transactions, 'accounts' => $accounts, 'categories' => $categories, 'budgets' => $budgets, 'tags' => $tags]; } return view('search.index', compact('title', 'subTitle', 'limit', 'mainTitleIcon', 'query', 'result')); } }