mercredi 24 mars 2021

How to make search system work in laravel which can run through an array stored as string in database?

I wish to make a search box which will run the search query. I have stored my data in database table in this form

asdf,english class science 5,chapter 1

I wish to use, to seperate between different tags.

I need to search across this. So if the user types chapter1 the search query should be able to pick up the chapter1 in the row. At present the search query is not able to pick anything. My code is as follows:

 $tag = $request->search;
    $query = Comics::where('comics_tag','LIKE','%'.$tag.'%')
    ->get();
    var_dump($query);die();

How to resolve it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire