title: Laravel Nova get the value of selected item in Select field
body: <p>I have a select field in my resource that looks like this:</p>
  
  <pre><code>Select::make('Category', 'category')-&gt;options([
      'local' =&gt; 'Local',
      'ftp' =&gt; 'FTP',
  ]),
  </code></pre>
  
  <p>Now I want to display an other field based on the value a user selects in the Category field.</p>
  
  <p>I use this package for conditional fields: 
  <a href="https://github.com/epartment/nova-dependency-container" rel="nofollow noreferrer">https://github.com/epartment/nova-dependency-container</a></p>
  
  <p>And this package for json schema's: <a href="https://github.com/NikolaySav/nova-json-schema-field" rel="nofollow noreferrer">https://github.com/NikolaySav/nova-json-schema-field</a></p>
  
  <p>My goals is to display a different json schema for the user to fill in based on the category they have selected.</p>
  
  <p>This is my code:</p>
  
  <pre><code>NovaDependencyContainer::make([
              NovaJsonSchemaField::make('Properties', $this-&gt;schema($category))
                  -&gt;listClass('list-reset'),
  ])-&gt;dependsOnNotEmpty('category'),
  
  private function schema($category): array
  {
      $allSchemas = [
                      'ftp' =&gt; [
                          'type' =&gt; 'object',
                          'required' =&gt; [
                              'foo',
                              'bar',
                          ],
                          'properties' =&gt; [
                              'foo' =&gt; [
                                  'type' =&gt; 'string',
                              ],
                              'bar' =&gt; [
                                  'type' =&gt; 'string',
                              ],
                          ],
                      ],
                  ];
  
      return $allSchemas[$category];
  }
  </code></pre>
  
  <p>But I don't know how I can fill up my $category variable with the selected category. The $category variable should be my selected value from the select.</p>
  
  <p>I don't find any information on this in the Nova documentation.</p>