Files
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

36 lines
875 B
PHP

<?php
namespace App\Http\Controllers\Mobile\ConectaSusAb\Sigtap;
use App\Http\Controllers\Controller;
use App\Models\Sigtap\Procedimento;
use App\Models\Sigtap\Competencia;
use Illuminate\Http\Response;
class ProcedimentoController extends Controller
{
public function index()
{
$listaCamposProcedimentos = [
'id',
'competencia_id',
'codigo',
'nome',
'complexidade',
'sexo',
'idade_minima',
'idade_maxima'
];
$ultimaCompetencia = Competencia::orderBy('valor', 'desc')->first(['id']);
$procedimentos = Procedimento::where('competencia_id', $ultimaCompetencia->id)
->select($listaCamposProcedimentos)
->get()
->toArray();
return response()->json($procedimentos, Response::HTTP_OK);
}
}