Category : search

The current search input of the datatables using Yajra is just accepting string/numbers that contains with, not starts with. I wanted to make it search by Starts With. Yajra Datatables has a snippet in their docs but I doen’t understand a thing on how to use it: https://yajrabox.com/docs/laravel-datatables/master/starts-with-search Does anyone know how to use this? ..

Read more

I have a live search in laravel 7 everything works good but I cant add (href a tag) to result list because result show in select option (select2 library) without (a) tag and cant be open in a new page for see result for this keyword my blade: <div class="fre-search-wrap"> <select class="livesearch form-control" name="Find Consultants"></select> ..

Read more

i have an couloum in database in which i store array to store device specification in an array i think its array in a array now i want to get devices where for example technology 5G is Yes Value here is the below code and database entry of array Array Of Specs in database a:12:{s:6:"Launch";a:2:{s:9:"Announced";s:12:"2019, ..

Read more

Someone recommended me using spatie/laravel-query-builder for filtering/searching data when I ask about how to filter data that had relationship. I’m still confused by it. What I’m trying to do: filter/search data with roles of ‘Student'(relationship) and contain the ‘x’ word. mycontroller.php before adding any spatie/query-builder code public function searchStudent(Request $request) { $user = Auth::user(); // ..

Read more

i have category and price and title search in one form they don’t work except all is filled i want like if anything not filled it show all products not to return null array and here is the code Controller public function all_products(Request $request){ $products = Product::OrderBY(‘views’,’desc’)->Paginate(8); $cats = Category::OrderBY(‘id’,’asc’)->Paginate(3); $cat = Category::all(); $q=$request->q; $from_price=(float)$request->from_price; ..

Read more

I have a project that requires 3 different table search in Laravel, but so far only one of them working while the rest are getting ‘Error 404’. Table Search That’s Working & The Page [MySQL Database Table File][1] [Table Page File][2] [Search File Page][3] The Error and Previous Page before error [Error404 at Search Materi ..

Read more

I’d like to search misspelled word, for example if user type: ‘parmacist’ my search will get all results that contains the word ‘pharmacist’. I tried with ‘%Like%’ and ‘Full Text’ but doesn’t work. Like Search $query = $request->input(‘query’); Post::select(‘name’)->where("name","LIKE","%{$query}%")->get(); Full Text $query = $request->input(‘query’); Post::select(‘name’)->whereRaw("MATCH(name) AGAINST(?)",array($query)); There is a way for get it? thanks! Source: ..

Read more

First a demonstration if there is a value: Text Field: <input type="text" id="search_category" class="search_category" placeholder="Search by Category" value="a"> Ajax function: (to show the data from the textfield being taken) var search_category = $(‘#search_category’).val(); —————————————— $.ajax({ type: "GET", url: "/clinical/bbr-category-configuration-data/"+search_category, SQL Select: public function fetchcategory($search_category){ $all_categories = HmsBbrCategory::query() ->when(empty($search_category), function ($query) { $query->where(‘category_id’, ‘>=’, ‘1’); }) ..

Read more

I have a words table and I want to keep a search form in my index view to search intended word. This is function that I have wrote for search in controller. public function search(string $id){ if($id!="") { $terms = Terms::query() ->where(‘term’, $id) ->get(); if(count($terms)==0) { $terms = Terms::query() ->where(‘term’, ‘LIKE’, "{$id}%") ->orWhere(‘term’, ‘LIKE’, "%{$id}%") ..

Read more

I’m trying to implement a live search in my laravel application. Following is my index function in the controller (ParticipantController.php). Here if there is no search happens, then displaying the participants by default. public function index(Request $request) { if($request->ajax()){ $data = User::orderBy(‘id’,’DESC’) ->WHERE(‘role_id’,’=’,’3′) ->where(’email’,’LIKE’,’%’.$request->search."%") ->paginate(12); return view(‘admins.participants.index’,compact(‘data’)) ->with(‘i’, ($request->input(‘page’, 1) – 1) * 12 ); ..

Read more