Change supplier resources to use components

This commit is contained in:
2024-08-18 13:58:18 +10:00
parent 283ae06a5c
commit 5139b26a05
12 changed files with 255 additions and 558 deletions

View File

@@ -1,3 +1,5 @@
@use(App\Models\Supplier)
@extends('adminlte::layouts.app')
@section('htmlheader_title')
@@ -27,16 +29,7 @@
<div class="row">
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
@include('adminlte::widget.form_select',[
'label'=>'Supplier',
'icon'=>'fas fa-handshake',
'id'=>'supplier_id',
'old'=>'supplier_id',
'name'=>'supplier_id',
'groupby'=>'active',
'options'=>\App\Models\Supplier::orderBy('active','DESC')->orderBy('name')->get()->transform(function($item) { return ['id'=>$item->id,'value'=>$item->name,'active'=>$item->active]; }),
'value'=>'',
])
<x-leenooks::form.select name="supplier_id" icon="fa-handshake" label="Supplier" choose="true" groupby="active" :options="$x=Supplier::orderBy('active','DESC')->orderBy(DB::Raw('UPPER(name)'))->get()->map(fn($item)=>['id'=>$item->id,'active'=>$item->active,'value'=>$item->name])"/>
</div>
</div>
</form>
@@ -47,9 +40,6 @@
@endsection
@section('page-scripts')
@css(select2)
@js(select2,autofocus)
<script type="text/javascript">
$(document).ready(function() {
$('#supplier_id')