Use map() instead of transform(), use fn() instead of function(), consistent coding for form.select
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
<!-- ($o??$user)=User::class -->
|
||||
@use(App\Models\Country)
|
||||
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
@@ -14,8 +17,6 @@
|
||||
{{ ($o??$user)->role }}
|
||||
@endsection
|
||||
|
||||
@use(App\Models\Country)
|
||||
<!-- ($o??$user)=User::class -->
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@@ -93,7 +94,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<x-leenooks::form.select id="country" name="country_id" icon="fa-globe" label="Country" :value="($o??$user)->country_id ?? ''" :options="Country::select(['id','name'])->active()->get()->map(function($item) { $item->value = $item->name; return $item; })->toArray()"/>
|
||||
<x-leenooks::form.select id="country" name="country_id" icon="fa-globe" label="Country" :value="($o??$user)->country_id ?? ''" :options="Country::select(['id','name'])->active()->get()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user