init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Controllers\Mobile\ConectaSusAb\Cadastro;
use App\Http\Controllers\Controller;
use App\Models\Cadastro\SujeitoAtencao\Alergia;
use Illuminate\Http\Response;
class AlergiaController extends Controller
{
protected $modulo = 'cadastro';
protected $funcionalidade = 'alergia';
public function index()
{
$alergias = Alergia::with(['tipo'])
->orderBy('agente_substancia_especifica')
->get()
->map(function ($alergia) {
return [
'id' => $alergia->id,
'agente_substancia_especifica' => $alergia->agente_substancia_especifica,
'tipo_id' => $alergia->tipo->id,
'tipo_descricao' => $alergia->tipo->descricao,
];
});
return response()->json($alergias, Response::HTTP_OK);
}
}