1 Select input depends on another Select input's value. Select's options populated by DB table's col

Currently I got this
return $form
    ->schema([

        Forms\Components\Select::make('model')
        Forms\Components\Select::make('model_id')

Model is a select menu, it can be Aaa or Bbb.
Model_id is also a select menu,

How can you achieve the below:

If Model is selected to have a value of Aaa,
then Model_id's options will be:
1: aaa1
2: aaa2

1:aaa1 and 2:aaa2 are read from DB table aaas's id and name columns.
If Model is selected to have a value of Bbb,
then Model_id's options will be:
1: bbb1
2: bbb2

1:bbb1 and 2:bbb2 are read from DB table bbbs's id and name columns.
Was this page helpful?