I use Accessor for my Model
public function getStatusAttribute($value) {
switch ($value) {
case 1:
return 'Active';
break;
default:
return 'Nonactive';
break;
}
}
How can I run a whereRaw based on a value? something like this:
if
$search = 'act';
$user = User::whereRaw("status like '%$search%'");
Is there a way to do this?
I expected, i can get User Data with status by searching similar 'active' or 'nonactive' , not '0' or '1'