File manager - Edit - /var/www/html/portal/app/Http/Resources/DividaAtiva/DividaAtivaRegistrosResource.php
Back
<?php namespace App\Http\Resources\DividaAtiva; use App\Models\User; use App\Models\Empresa; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class DividaAtivaRegistrosResource extends Controller { public static function getUserId(Request $request): string { $self = new self(); $user_id = (string) env('USUARIO_MIGRACAO_ID'); $cpf = $self->clearCpfCnpj((string) $request->cpf); $cnpj = $self->clearCpfCnpj((string) $request->cnpj); if (strlen($cpf) === 11) { $user = User::where('cpf', $cpf)->first(); if ($user && $user->id) { $user_id = (string) $user->id; } } if (strlen($cnpj) === 14) { $empresa = Empresa::where('cnpj', $cnpj)->first(); if ($empresa && $empresa->id) { $user_id = (string) $empresa->responsavel_id; } } return $user_id; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings