94 lines
3.4 KiB
PHP
94 lines
3.4 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::middleware(['customer', 'gate', 'jwt.auth'])->group(function () {
|
|
// The prefix is optional. If not present, the directory name will be the prefix.
|
|
$routesConfig = [
|
|
// ['directory' => 'directory-name', 'prefix' => 'prefix-name'],
|
|
['directory' => 'administracao'],
|
|
['directory' => 'almoxarifado'],
|
|
['directory' => 'ambulatorio'],
|
|
['directory' => 'apac'],
|
|
['directory' => 'atencao-basica'],
|
|
['directory' => 'bpa'],
|
|
['directory' => 'cadastro'],
|
|
['directory' => 'dashboard'],
|
|
['directory' => 'exame-imagem'],
|
|
['directory' => 'exame-laboratorial'],
|
|
['directory' => 'farmacia'],
|
|
['directory' => 'geral'],
|
|
['directory' => 'imunizacao'],
|
|
['directory' => 'integracao'],
|
|
['directory' => 'intranet'],
|
|
['directory' => 'manutencao'],
|
|
['directory' => 'mobile/conectasus-ab/administracao'],
|
|
['directory' => 'mobile/conectasus-ab/atencao-basica'],
|
|
['directory' => 'mobile/conectasus-ab/cadastro'],
|
|
['directory' => 'mobile/conectasus-ab/geral'],
|
|
['directory' => 'mobile/conectasus-ab/intranet'],
|
|
['directory' => 'mobile/conectasus-ab/sigtap'],
|
|
['directory' => 'mobile/conectasus-ab/sincronizacao'],
|
|
['directory' => 'painel-senha'],
|
|
['directory' => 'parametrizacao'],
|
|
['directory' => 'portal-divulgacao'],
|
|
['directory' => 'pronto-atendimento'],
|
|
['directory' => 'raas'],
|
|
['directory' => 'regulacao'],
|
|
['directory' => 'regulacao-divulgacao'],
|
|
['directory' => 'rest-pki'],
|
|
['directory' => 'router-info'],
|
|
['directory' => 'sigtap'],
|
|
['directory' => 'transporte-paciente'],
|
|
['directory' => 'web-service'],
|
|
['directory' => 'websocket'],
|
|
];
|
|
|
|
foreach ($routesConfig as $config) {
|
|
$path = 'routes' . DIRECTORY_SEPARATOR . $config['directory'] . DIRECTORY_SEPARATOR;
|
|
|
|
$prefix = $config['prefix'] ?? $config['directory'];
|
|
|
|
Route::prefix($prefix)->name("{$prefix}.")->group(function () use ($path) {
|
|
foreach (File::allFiles(base_path($path)) as $file) {
|
|
require $file->getPathname();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
Route::middleware(['customer', 'auth:mobile'])->group(function () {
|
|
$routesConfig = [
|
|
['directory' => 'mobile/conecta-cidadao'],
|
|
];
|
|
|
|
foreach ($routesConfig as $config) {
|
|
$path = 'routes' . DIRECTORY_SEPARATOR . $config['directory'] . DIRECTORY_SEPARATOR;
|
|
|
|
$prefix = $config['prefix'] ?? $config['directory'];
|
|
|
|
Route::prefix($prefix)->name("{$prefix}.")->group(function () use ($path) {
|
|
foreach (File::allFiles(base_path($path)) as $file) {
|
|
require $file->getPathname();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
$etcPath = 'routes' . DIRECTORY_SEPARATOR . 'etc' . DIRECTORY_SEPARATOR;
|
|
|
|
foreach (File::allFiles(base_path($etcPath)) as $file) {
|
|
require $file->getPathname();
|
|
}
|
|
|
|
Route::middleware(['customer', 'guard:external', 'jwt.auth', 'token.parameters'])->group(function () {
|
|
$prefix = 'externo';
|
|
$path = 'routes' . DIRECTORY_SEPARATOR . $prefix . DIRECTORY_SEPARATOR;
|
|
|
|
Route::prefix($prefix)->name("{$prefix}.")->group(function () use ($path) {
|
|
foreach (File::allFiles(base_path($path)) as $file) {
|
|
require $file->getPathname();
|
|
}
|
|
});
|
|
});
|