Closed DuyenNguyen66 closed 1 year ago
hi @DuyenNguyen66
all fields inside a dependency container are NOT displayed on index. you need to work around this fact.
e.g.
...
DependencyContainer::make([
Select::make('Parent name', 'parent_id')
->options(
\App\Models\Category::whereCode('column')
->whereNull('parent_id')
->pluck('name', 'id'))
->displayUsingLabels()
])->dependsOn('code', 'column'),
Select::make('Parent name ONLY for index', 'parent_id')
->options(
\App\Models\Category::whereCode('column')
->whereNull('parent_id')
->pluck('name', 'id'))
-> onlyOnIndex(),
...
Thank for your answer. I can handle like your answer, it's ok for now.
But I have another question. Can we use rules
method in a dependency container? I placed rules
method like picture but it's not working.
Example:
I used a select field - Parent name on DependencyContainer. The selected option can be shown on detail, but not on Index. Is that a bug?
Detail
Index