company creator updated

This commit is contained in:
Thekindbull 2025-02-05 09:27:46 +08:00
parent 2adeb403cf
commit 9940c10a33
2 changed files with 14 additions and 10 deletions

View File

@ -31,6 +31,7 @@ public function __invoke(Request $request)
'secret' => bin2hex(random_bytes(16)),
'status' => 'new'
]);
//dd($request->all());
$data = $request->only('name', 'email', 'inn', 'legal_address', 'secret', 'status', 'type', 'phone');
$company = Company::create($data);
if (!$company)

View File

@ -10,16 +10,19 @@
@csrf
<div class="mb-3">
<label for="companyType" class="form-label">Статус регистрации</label>
<select class="form-select" @if($type) disabled @endif id="companyType" name="type" value="{{ old('type') }}">
@foreach($typesList as $typesItem)
<option value="{{$typesItem->name}}">{{ __($typesItem->name) }}</option>
@endforeach
</select>
@error('type')
<span class="invalid-feedback d-block" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@if($type)
<input type="text" class="form-control d-none" id="companyType" name="type" value="{{ $type }}">
@endif
<select class="form-select" @if($type) disabled @endif id="companyType" name="type" value="{{ old('type') }}">
@foreach($typesList as $typesItem)
<option value="{{$typesItem->value}}" @if($type == $typesItem->value) selected @endif>{{ __($typesItem->name) }}</option>
@endforeach
</select>
@error('type')
<span class="invalid-feedback d-block" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
@if($type)
<div class="mb-3">