Hosting domain_name input, ensure we redirect back to the update page

This commit is contained in:
Deon George 2022-08-03 15:28:27 +10:00
parent 2bac177618
commit dd76fda274
3 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Validator;
use Illuminate\View\View;
use Symfony\Component\HttpKernel\Exception\HttpException;
@ -379,6 +380,7 @@ class ServiceController extends Controller
public function update(Request $request,Service $o)
{
if ($o->type->validation()) {
Session::put('service_update',true);
$validator = Validator::make($x=$request->post($o->category),$o->type->validation());
if ($validator->fails()) {

View File

@ -92,7 +92,7 @@
@include('service.widget.internal')
</div>
<div class="tab-pane fade {{ session()->has('service_update') ? 'active show' : '' }}" id="update" role="tabpanel">
<div class="tab-pane fade {{ session()->pull('service_update') ? 'active show' : '' }}" id="update" role="tabpanel">
@include('service.widget.update')
</div>
@endcan

View File

@ -7,7 +7,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-fw fa-globe-asia"></i></span>
</div>
<input type="text" style="width:55%;" class="form-control text-right @error('domain_name') is-invalid @enderror" id="domain_name" name="domain[domain_name]" placeholder="Domain Name..." value="{{ old('host.domain_name',$o->domain_name) }}" required>
<input type="text" style="width:55%;" class="form-control text-right @error('domain_name') is-invalid @enderror" id="domain_name" name="host[domain_name]" placeholder="Domain Name..." value="{{ old('host.domain_name',$o->domain_name) }}" required>
<div class="input-group-append">
<span class="input-group-text">.</span>