Answers for "laravel like operator"

PHP
0

add like and equal in same query in laravel

$data = DB::table('borrowers')
        ->join('loans', 'borrowers.id', '=', 'loans.borrower_id')
        ->select('borrowers.*', 'loans.*')   
        ->where('loan_officers', 'like', '%' . $officerId . '%')
        ->where('loans.maturity_date', '<', date("Y-m-d"))
        ->get();
Posted by: Guest on October-19-2020
8

laravel where like

$users = DB::table('users')
                ->where('name', 'like', 'T%')
                ->get();
Posted by: Guest on May-13-2020
0

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();
Posted by: Guest on August-17-2021

Browse Popular Code Answers by Language