Using Eloquent ORM in Laravel to perform search of database using LIKE

前端 未结 5 1815
清歌不尽
清歌不尽 2020-12-04 15:14

I want to use Eloquent\'s active record building to build a search query, but it is going to be a LIKE search. I have found the User::find($term) or User:

5条回答
  •  忘掉有多难
    2020-12-04 15:49

    You're able to do database finds using LIKE with this syntax:

    Model::where('column', 'LIKE', '%value%')->get();
    

提交回复
热议问题