of(JornadaService::datatable($request)) ->filterColumn('cadastro_cidadao.data_nascimento', function ($query, $keyword) { $query ->whereRaw("DATE_FORMAT(cadastro_cidadao.data_nascimento, '%d/%m/%Y') like ?", ["%{$keyword}%"]) ->orWhereRaw( "CONCAT( SUBSTR(cadastro_cidadao.data_nascimento,9,2), SUBSTR(cadastro_cidadao.data_nascimento,6,2), SUBSTR(cadastro_cidadao.data_nascimento,1,4) ) like ?", ["%{$keyword}%"] ); }) ->filterColumn('cadastro_cidadao.cpf', function ($query, $keyword) { $query ->whereRaw("cadastro_cidadao.cpf like ?", ["%{$keyword}%"]) ->orWhereRaw( "CONCAT( SUBSTR(cadastro_cidadao.cpf,1,3), '.', SUBSTR(cadastro_cidadao.cpf,4,3), '.', SUBSTR(cadastro_cidadao.cpf,7,3), '-', SUBSTR(cadastro_cidadao.cpf,10,2) ) like ?", ["%{$keyword}%"] ); }) ->skipTotalRecords() ->toJson(); } public function show($id) { return response()->json(JornadaService::show($id), Response::HTTP_OK); } public function store(Request $request) { return response()->json(JornadaService::store($request), Response::HTTP_CREATED); } public function getSupervisores(Request $request) { return response()->json(JornadaService::getSupervisores($request), Response::HTTP_OK); } }