Skip to content
Discussion options

You must be logged in to vote

EMailAction::make($resource->locale), // will work on Detail + Action Click, but not on index if more than one is selected

Obviously, this would cause an issue when locale can now be multiple (different for each resource) but there's only a single instance of EMailAction. You should only allow this action to be selected for following usage:

  1. Single resource selected from Index
  2. Inline action button
  3. Detail page
EMailAction::make()->canSee(function (NovaRequest $request) {
    return $request->selectedResourceIds()?->count() === 1;
})->showInline()->showOnDetail(),
    /**
     * Perform the action on the given models.
     *
     * @param  \Laravel\Nova\Fields\ActionFields  $fields

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@crynobone
Comment options

@jansgescheit
Comment options

@crynobone
Comment options

@crynobone
Comment options

Answer selected by jansgescheit
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants