Section::make()->schema([
Select::make('Customer')->options(Models\Customer::all()->pluck('CompanyName', 'ID')
->sort(function ($customer1, $customer2) {
return strtolower($customer1) <=> strtolower($customer2);
}))->label('Customer')
->live(),
//->searchable(),
// })->reactive(),
//->debounce(600),
Select::make('Contact')
->options(function (Get $get): Collection {
$customer_id = $get("Customer");
$results = Models\CustomerContact::where('CustomerId', $customer_id)->pluck('Name', 'CustomerContactID')
->sort(function ($customer1, $customer2) {
return strtolower($customer1) <=> strtolower($customer2);
});
return $results;
})
->label('Contact')
->searchable(),
Section::make()->schema([
Select::make('Customer')->options(Models\Customer::all()->pluck('CompanyName', 'ID')
->sort(function ($customer1, $customer2) {
return strtolower($customer1) <=> strtolower($customer2);
}))->label('Customer')
->live(),
//->searchable(),
// })->reactive(),
//->debounce(600),
Select::make('Contact')
->options(function (Get $get): Collection {
$customer_id = $get("Customer");
$results = Models\CustomerContact::where('CustomerId', $customer_id)->pluck('Name', 'CustomerContactID')
->sort(function ($customer1, $customer2) {
return strtolower($customer1) <=> strtolower($customer2);
});
return $results;
})
->label('Contact')
->searchable(),