Closed shineirvin closed 4 years ago
Hi @shineirvin, unfortunately, I don't know how to do that :( Maybe you can use a static list of items...
You could use some cache :
$items = Cache::rememberForever('MY_CACHE_KEY', function () {
return Item::all()->pluck('name', 'id');
});
return [
Select2::make('Items', 'itemList')
->options($items),
];
Don't forget to forget your Cache on create, delete or update of your item model
@shineirvin can U describe problem?
How do I prevent the N+1 Query issue ?