laravel where like
snippet in php

add like and equal in same query in laravel

user2469

$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();

laravel where like

user5038

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

laravel orWhere

user2785

$camps = $field->camps()->where('status', 0)->where(function ($q) {
    $q->where('sex', Auth::user()->sex)->orWhere('sex', 0);
})->get();

where like laravel

user9533

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

laravel where and where

user8185

Table::where('Column', Value)->where('NewColumn', Value)->get();