Laravel When Condition on a column
I have a ModelA with columns: name, last_name, email I want ModelA with the name Test to add an extra where on email what I tried is the following $model_a_res = A::when( function($query){ return $query->where('name','Test'); }, function ($query) { $query->where('email',…