дебак с контрактами

This commit is contained in:
developer 2026-04-01 10:12:02 +08:00
parent ef9fdb0e2e
commit e94d6d5e4e
2 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,8 @@ public function __invoke(Request $request, Company $company)
'user_id' => $user->id, 'user_id' => $user->id,
'company_id' => $company->id 'company_id' => $company->id
]); ]);
Agent::where('user_id', $user->id)->delete();//удаляю, если уже была агентская учетка
Agent::create([ Agent::create([
'user_id' => $user->id, 'user_id' => $user->id,
'company_id' => $company->id 'company_id' => $company->id

View File

@ -63,7 +63,7 @@
'icon' => 'gear', 'icon' => 'gear',
]; ];
} }
if (auth()->user()->hasRole($roles::SUPER_ADMIN) || auth()->user()->hasRole($roles::CITY_MANAGER)) { if (auth()->user()->hasRole($roles::SUPER_ADMIN)) {
$items[] = [ $items[] = [
'target' => 'route', 'target' => 'route',
'route' => 'admin.index', 'route' => 'admin.index',