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 :: magento get admin url 
Php :: php get file extension from filename 
Php :: laravel storage symlink 
Php :: laravel asset storage not working 
Php :: php limit string length 
Php :: show error php in htaccess 
Php :: laravel route list 
Php :: php loop 
Php :: php if no imagee exists 
Php :: php function to remove underscore 
Php :: wp_dequeue_style 
Php :: get age with carbon in laravel 
Php :: php call parent constructor 
Php :: php location 
Php :: php time format am pm 
Php :: laravel request all except token 
Php :: download php7.4-mbstring ubuntu 
Php :: get image extension in php 
Php :: wordpress get the main url 
Php :: enie letter validation laravel regex 
Php :: how to get previous page name in php 
Php :: orwherebetween laravel 
Php :: laravel search data relationship 
Php :: generate autodump laravel 
Php :: page load time in php 
Php :: php loop through array 
Php :: how to open server in php 
Php :: laravel inline if 
Php :: magento 2 get connection 
Php :: add days to date with laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =