Make $setup available to all blades
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s Details
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m46s Details
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s Details

This commit is contained in:
Deon George 2024-06-07 15:08:50 +10:00
parent 153e4dc12b
commit b23d9351b5
4 changed files with 7 additions and 6 deletions

View File

@ -6,6 +6,8 @@ use Closure;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\Auth\Authenticatable;
use App\Models\Setup;
class AddUserToView
{
/**
@ -44,6 +46,7 @@ class AddUserToView
public function handle($request, Closure $next)
{
$this->factory->share('user',$this->user);
$this->factory->share('setup',Setup::find(config('app.id')));
return $next($request);
}

View File

@ -5,9 +5,7 @@
@php
use App\Classes\Protocol\Binkp;
use App\Models\Setup;
$user->load(['systems.akas.zone.domain.echoareas','systems.akas.echoareas']);
$setup = Setup::findOrFail(config('app.id'));
@endphp
@section('content')

View File

@ -1,6 +1,6 @@
@php
use App\Classes\FTN\Packet;
use App\Models\{Mailer,Setup,User};
use App\Models\{Mailer,User};
@endphp
<!-- $o=System::class -->
@ -195,7 +195,7 @@ use App\Models\{Mailer,Setup,User};
<label for="pkt_msgs" class="form-label w-100">Packet Msgs</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-hash"></i></span>
<input type="text" class="form-control text-end @error('pkt_msgs') is-invalid @enderror" id="pkt_msgs" placeholder="{{ Setup::MAX_MSGS_PKT }}" name="pkt_msgs" value="{{ old('pkt_msgs',$o->getRawOriginal('pkt_msgs')) }}" @cannot($action,$o)readonly @endcannot>
<input type="text" class="form-control text-end @error('pkt_msgs') is-invalid @enderror" id="pkt_msgs" placeholder="{{ $setup->msgs_pkt }}" name="pkt_msgs" value="{{ old('pkt_msgs',$o->getRawOriginal('pkt_msgs')) }}" @cannot($action,$o)readonly @endcannot>
<span class="invalid-feedback" role="alert">
@error('pkt_msgs')
{{ $message }}

View File

@ -5,7 +5,7 @@
@endsection
@php
use App\Models\{Setup,System};
use App\Models\System;
@endphp
@section('content')
@ -28,7 +28,7 @@ use App\Models\{Setup,System};
<option value="">&nbsp;</option>
@foreach (System::select(['systems.id','systems.name'])
->active()
->where('id','<>',Setup::findOrFail(config('app.id'))->system_id)
->where('id','<>',$setup->system_id)
->whereRaw('id NOT IN (SELECT system_id FROM system_user)')
->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('id')===$oo->id)selected @endif>{{ $oo->name }}</option>