@@ -12,6 +12,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rule;
|
||||
use LogicException;
|
||||
|
||||
class EducationInvestmentController extends Controller
|
||||
{
|
||||
@@ -44,9 +45,13 @@ class EducationInvestmentController extends Controller
|
||||
return;
|
||||
}
|
||||
$territory = app(InvestmentGeography::class)->selection($data, true);
|
||||
$lastTerritoryKey = array_key_last($territory);
|
||||
if ($lastTerritoryKey === null) {
|
||||
throw new LogicException('A proposta educativa exige uma localização territorial.');
|
||||
}
|
||||
$province = $territory[0];
|
||||
$district = $territory[1] ?? null;
|
||||
$primaryTerritory = $territory[array_key_last($territory)];
|
||||
$primaryTerritory = $territory[$lastTerritoryKey];
|
||||
$reference = 'EDU-'.Str::uuid();
|
||||
$opportunity = new Opportunity;
|
||||
PortalAudit::save($opportunity, [
|
||||
|
||||
Reference in New Issue
Block a user