0
I have a function in the Repository to list only the employees not dismissed on a certain date
use Parametergroup, but the condition does not find the $date parameter of the function, giving the error: "Undefined variable: date"
public function listarFuncionariosAtivos($data)
{
$funcionarios = Funcionario::where('demitido', '0')
->orWhere(function($query) {
$query->whereNotNull('data_demissao')
->where('data_demissao', '>=', $data);
})
->orderBy('nome')
->get(['id','nome','salario','data_admissao','data_demissao']);
return $funcionarios;
Thank you, solved!
– Isabella Cordovil