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 :: add footer code 
Php :: set cookie on button click JavaScript 
Php :: php get multiple url parameters 
Php :: remove last 3 character from string php 
Php :: database, counts 
Php :: laravel pivot table model 
Php :: composer install phpWord 
Php :: laravel array search blade 
Php :: php check jwt token expired 
Php :: laravel PageController.php 
Php :: php file_get_contents html with special characters 
Php :: laravel resource 
Php :: wordpress post add input field 
Php :: isset 
Php :: laravel valet subdomain 
Php :: make controller and model laravel 
Php :: laravel api 
Php :: add character after x characters in php 
Php :: check php-fpm version ubuntu 
Php :: wp_schedule_event 
Php :: find diiference in minutes un laravel 
Php :: connect php in sql server 
Php :: php increment variable 
Php :: cara membuat koneksi php 
Php :: php print string as bytes 
Php :: How to create routes in the codeigniter 
Php :: multiple primary key defined laravel 
Php :: make php website https 
Php :: laravel @class 
Php :: substr last 3 characters 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =