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 :: how to create access token in laravel 
Php :: Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php 
Php :: laravel migration string length 
Php :: cronjob php linux 
Php :: laravel migration alter column unique 
Php :: how to include pdf in php page using embed tag 
Php :: hoew to store a cookie php 
Php :: check if given date time is of today or yesterday php 
Php :: openssl encrypt php with key 
Php :: laravel request password validation rule 
Php :: magento 2.3 check if customer is logged in 
Php :: get key of array element php 
Php :: guzzle get request 
Php :: ?? ternary operator in php 
Php :: add bootstrap class to checkout fields woocommerce 
Php :: array_column in php 
Php :: pretty json php 
Php :: Php get all timezone 
Php :: laravel blank page 
Php :: where () laravel Eloquent 
Php :: delete button laravel 
Php :: throwable php 
Php :: wp reserved image size names 
Php :: check what kind of file was uploaded php 
Php :: autoload_namespaces.php failed to open stream: Permission denied 
Php :: include() in php 
Php :: php regular expression function 
Php :: how to set select option value dynamically in php 
Php :: How To Check If A String Ends With Another String In PHP 
Php :: category title in post 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =