Skip to content

Action with Depends On doesn't work correctly - Nova 4 #3897

@kevariable

Description

@kevariable
  • Laravel Version: ^9.0
  • Nova Version: "^4.0"
  • PHP Version: "php": "^8.0",
  • Database Driver & Version: MySQL version 8
  • Operating System and Version: Arch Linux
  • Browser type and version: Chromium Latest Version
  • Reproduction Repository: -

Description:

Depends On feature doesn't work after upgrading from Laravel Nova 3 for Action

Detailed steps to reproduce the issue on a fresh Nova installation:

Following all upgrade guide

Code

Select::make('Name', 'name')
      ->options([
          'xxx' => 'xxx'
      ])->rules('required'),

  Text::make('Store Name')
       ->hide()
      ->dependsOn('name', function (Text $field, NovaRequest $request, FormData $formData) {
      
         // I tries to Log no data was attached here
      
          $field
             ->show()
              ->rules([
                  'required',
                  'max:15',
                  Rule::unique(Channel::class)->where('name', $formData->name)
              ])
              ->help(Str::replace(':name',  $formData->name, 'Please enter your :name xxx name'));
      }),

Screenshots

image

Let me know if need more details on specify issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestFeature Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions