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)), 'secret' => bin2hex(random_bytes(16)),
'status' => 'new' 'status' => 'new'
]); ]);
//dd($request->all());
$data = $request->only('name', 'email', 'inn', 'legal_address', 'secret', 'status', 'type', 'phone'); $data = $request->only('name', 'email', 'inn', 'legal_address', 'secret', 'status', 'type', 'phone');
$company = Company::create($data); $company = Company::create($data);
if (!$company) if (!$company)

View File

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