company confirmer fixed
This commit is contained in:
parent
c896647a35
commit
2f8444f4a4
@ -24,17 +24,17 @@ public function __invoke(Request $request)
|
||||
$company = Company::create($data);
|
||||
if (!$company)
|
||||
{
|
||||
return back()->with('error', __('Company creation error'))->withInput();
|
||||
return back()->withErrors(['msg' => 'Company creation error'])->withInput();
|
||||
}
|
||||
$data['callback_url'] = route('company.status.update', [
|
||||
'company' => $company->id,
|
||||
'company_id' => $company->id,
|
||||
'secret' => $company->secret
|
||||
]);
|
||||
$companyConfirmByBitrix = new SendCompany($company->id, $data);
|
||||
if (!$sender = $companyConfirmByBitrix->send())
|
||||
{
|
||||
$company->delete();
|
||||
return back()->with('error', __('Company creation error'))->withInput();
|
||||
return back()->withErrors(['msg' => 'Company creation error'])->withInput();
|
||||
}
|
||||
return view('company.created');
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@ public function send()
|
||||
'content' => $postdata
|
||||
)
|
||||
);
|
||||
|
||||
try
|
||||
{
|
||||
$context = stream_context_create($opts);
|
||||
|
||||
@ -55,7 +55,7 @@ public function send()
|
||||
$data = [
|
||||
'IBLOCK_TYPE_ID' => $this->IBLOCK_TYPE_ID,
|
||||
'IBLOCK_ID' => $this->IBLOCK_ID,
|
||||
'ELEMENT_CODE' => $this->ID,
|
||||
'ELEMENT_CODE' => 'lk' . $this->ID,
|
||||
'FIELDS' => $this->data
|
||||
];
|
||||
$sender = new BitrixSender($this->URL, $data);
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Create company form') }}</div>
|
||||
<div class="card-header">Форма регистрации агентства</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('company.create') }}" method="post">
|
||||
@csrf
|
||||
|
||||
@ -37,6 +37,9 @@
|
||||
<img src={{ url('/images/logo.png') }} alt="Alfa logo" width="70">
|
||||
</div>
|
||||
</div>
|
||||
@if ($errors->any())
|
||||
{!! implode('', $errors->all('<div>:message</div>')) !!}
|
||||
@endif
|
||||
@yield('content')
|
||||
</body>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user