mirror of
https://github.com/anna-sara/filament_inventory
synced 2025-10-26 21:37:14 +01:00
Updated create item category select
This commit is contained in:
parent
de94eb4e30
commit
b22d05538e
1 changed files with 14 additions and 2 deletions
|
|
@ -67,6 +67,7 @@ class ItemResource extends Resource
|
|||
->schema([
|
||||
Radio::make('type')
|
||||
->translateLabel()
|
||||
->live()
|
||||
->options([
|
||||
'game' => __('Game'),
|
||||
'item' => __('Item'),
|
||||
|
|
@ -99,9 +100,20 @@ class ItemResource extends Resource
|
|||
->default(0)
|
||||
->hidden(fn ($get): string => $get('type') == 'game' || $get('type') == 'literature' ),
|
||||
Select::make('category_id')
|
||||
->label('Category')
|
||||
->label('Category items')
|
||||
->translateLabel()
|
||||
->options(Category::all()->pluck('name', 'id')),
|
||||
->options(Category::where('type', 'item')->pluck('name', 'id'))
|
||||
->hidden(fn ($get): string => $get('type') == 'game' || $get('type') == 'literature' ),
|
||||
Select::make('category_id')
|
||||
->label('Category games')
|
||||
->translateLabel()
|
||||
->options(Category::where('type', 'game')->pluck('name', 'id'))
|
||||
->hidden(fn ($get): string => $get('type') == 'item' || $get('type') == 'literature' ),
|
||||
Select::make('category_id')
|
||||
->label('Category literature')
|
||||
->translateLabel()
|
||||
->options(Category::where('type', 'literature')->pluck('name', 'id'))
|
||||
->hidden(fn ($get): string => $get('type') == 'game' || $get('type') == 'item' ),
|
||||
TextInput::make('cost')
|
||||
->label('Price')
|
||||
->translateLabel()
|
||||
|
|
|
|||
Loading…
Reference in a new issue