1$result = Marriage::where('name','LIKE','%'.$email_or_name.'%')
2 ->orWhere('email','LIKE','%'.$email_or_name.'%')
3 ->get();
1$searchTerm ='milad zamir Abc';
2$reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];
3$searchTerm = str_replace($reservedSymbols, ' ', $searchTerm);
4
5$searchValues = preg_split('/\s+/', $searchTerm, -1, PREG_SPLIT_NO_EMPTY);
6
7$res = User::where(function ($q) use ($searchValues) {
8 foreach ($searchValues as $value) {
9 $q->orWhere('name', 'like', "%{$value}%");
10 $q->orWhere('family_name', 'like', "%{$value}%");
11 }
12})->get();