для отладки на боевой добавил временно возможность видеть токен компании в админке

This commit is contained in:
developer 2026-01-15 22:49:35 +08:00
parent f011fd2eae
commit afe70fb616
2 changed files with 19 additions and 15 deletions

View File

@ -45,6 +45,10 @@ public function edit(Company $company)
public function update(Request $request, Company $company)
{
$company->update($request->only('name', 'email', 'phone'));
if ($request->token) {
$company->bitrixy->token = $request->token;
$company->bitrixy->save();
}
return to_route('admin.companies.edit', ['company' => $company]);
}
public function delete(Company $company) {

View File

@ -32,12 +32,14 @@
@enderror
</div>
</div>
<div class="mb-3">
@if (env('APP_DEBUG'))
<div class="mb-3 d-none">
<label for="tokenFormControl" class="form-label">Секретный токен для вебхука</label>
<input type="text" disabled class="form-control" id="tokenFormControl" value="{{ $company->bitrixy->token }}">
<input type="text" class="form-control" name="token" id="tokenFormControl"
value="{{ $company->bitrixy->token }}">
<small style="font-size:10px">* Служебное поле доступно в режиме тестирования приложения</small>
</div>
@endif
<button type="submit" class="btn btn-primary">Сохранить</button>
</form>
@ -71,13 +73,12 @@
</td>
<td class="text-end">
<div class="dropdown" style="">
<button class="btn btn-light" type="button" id="dropdownMenuButton"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-light" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="bi bi-three-dots-vertical"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<form method="post"
action="{{ route('admin.users.role.delete', ['userRole' => 999]) }}">
<form method="post" action="{{ route('admin.users.role.delete', ['userRole' => 999]) }}">
@csrf
<button class="dropdown-item" type="submit">Удалить</button>
</form>
@ -121,13 +122,12 @@
</td>
<td class="text-end">
<div class="dropdown" style="">
<button class="btn btn-light" type="button" id="dropdownMenuButton"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-light" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="bi bi-three-dots-vertical"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<form method="post"
action="{{ route('admin.users.role.delete', ['userRole' => 999]) }}">
<form method="post" action="{{ route('admin.users.role.delete', ['userRole' => 999]) }}">
@csrf
<button class="dropdown-item" type="submit">Удалить</button>
</form>