I've googled for minutes and couldn't find an answer to my question. I want to search users with a string that have certain characters in the name and have a specified id_admin.
I want this
select * from users where name like '%searching name%' and id_admin = 300;
I am trying this
$resultado = User::where("name", "like", '%'. $nome . '%')->orWhere(function ($query) {
$query->where('id_admin', 300);
})->get();
This is ignoring the 300