Search
 
SCRIPT & CODE EXAMPLE
 

PHP

where like laravel

User::query()
   ->where('name', 'LIKE', "%{$searchTerm}%") 
   ->orWhere('email', 'LIKE', "%{$searchTerm}%") 
   ->get();

reference:
https://freek.dev/1182-searching-models-using-a-where-like-query-in-laravel
Comment

laravel where like

$users = DB::table('users')
                ->where('name', 'like', 'T%')
                ->get();
Comment

using where like in laravel 8

/**
* filter the user result
*
* @var array
*/
public function users()
{
    $search = "United States";
    
    $users = User::where('country', 'LIKE', '%'.$search.'%')
        ->get();

    dd($users);
}
Comment

laravel where like

Book::where('title', 'like', '%'.$this->search.'%')->get()
Comment

where like in laravel

$book = array('book2','book3','book5');  

$name = DB::Table('bookinfo')
        ->select('BookName', 'bookId')                
        ->Where(function ($query) use($book) {
             for ($i = 0; $i < count($book); $i++){
                $query->orwhere('bookname', 'like',  '%' . $book[$i] .'%');
             }      
        })->get();
Comment

where like laravel

$users = DB::table('users')
                ->where('votes', '>=', 100)
                ->get();

$users = DB::table('users')
                ->where('votes', '<>', 100)
                ->get();

$users = DB::table('users')
                ->where('name', 'like', 'T%')
                ->get();
Comment

laravel wherein like

$admin_permissions = Permission::all();
// Teacher Role
$teacher_permissions = $admin_permissions->filter(function ($permission) {
  return substr($permission->title, 0, 8) == 'teacher_';
});
Comment

LARAVEL LIKE

BookingDates::where('email', Input::get('email'))
    ->orWhere('name', 'like', '%' . Input::get('name') . '%')->get();
Comment

PREVIOUS NEXT
Code Example
Php :: heredoc 
Php :: php date time formatting 
Php :: send email php smtp 
Php :: laravel run function after forgot password 
Php :: Code for finding Prime Numbers 
Php :: how to execute php in linux 
Php :: with relation laravel 
Php :: laravel send data with a redirect 
Php :: image laravel 
Php :: create symfony project 
Php :: PHP Filters Advanced 
Php :: laravel imap - Set message flags 
Php :: acf field without spaces 
Php :: php artisan vendor:publish --provider="SpatieActivitylogActivitylogServiceProvider" --tag="activitylog-migrations" 
Php :: asas 
Php :: laravel remove public 
Php :: sample test tinker php artisan 
Php :: php check if variable is resource 
Php :: Drupal 8 / 9 entityTypeManager get multiple comments by cid 
Php :: check if product has crosssell woocommerce 
Php :: Laravel appends child when referencing it in attribute function 
Php :: laravel 7 link to another page with language prefix 
Php :: wordpress widget categories edit 
Php :: repalce 0 in phone with 234 
Php :: lewin muzvonda 
Php :: Unregistering a variable with $_SESSION. 
Php :: How to return custom error message from controller method validation 
Php :: Call to undefined method AppModelsespece::links() laravel 8 
Php :: php formula return more results 
Php :: way to convert an integer to an array of numbers 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =