auth(__FUNCTION__); return response()->json(FechamentoFaaMassaService::create(), Response::HTTP_OK); } public function list() { $this->auth(__FUNCTION__); return response()->json(FechamentoFaaMassaService::list(), Response::HTTP_OK); } public function store(Request $request) { $this->auth(__FUNCTION__); return response()->json(FechamentoFaaMassaService::store($request), Response::HTTP_CREATED); } public function datatable() { return datatables() ->of(FechamentoFaaMassaService::datatable()) ->filterColumn('pronto_atendimento_faa.created_at', function ($query, $keyword) { $query->whereRaw("DATE_FORMAT(pronto_atendimento_faa.created_at, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"]) ->orWhereRaw( "CONCAT( SUBSTR(pronto_atendimento_faa.created_at,9,2), SUBSTR(pronto_atendimento_faa.created_at,6,2), SUBSTR(pronto_atendimento_faa.created_at,1,4) ) like ?", ["%{$keyword}%"] ); }) ->filterColumn('cadastro_infraestrutura.nome', function ($query, $keyword) { $query->whereRaw("COALESCE(cadastro_infraestrutura.nome, cadastro_unidade.nome_fantasia) LIKE ?", ["%{$keyword}%"]); }) ->skipTotalRecords() ->make(true); } }