I am developing a Admin Panel using Laravel Nova. I know Laravel Nova is a new technology. Now I am having a bit of problem using Nova actions. I need to get the number of selected entries for the action. Please see the screenshot below.
As you can see in the screenshot, I selected two entries for the action. In Nova action class, in fields method of action class, I'd like to get the number of selected entries.
class ActivateUsers extends Action
{
use InteractsWithQueue, Queueable, SerializesModels;
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
}
}
public function fields()
{
//Here I need to get the number of selected entries
}
}
Please pay attention to the fields method of the Action and the comment in it. How can I get the number of selected entries in the fields method of the action class?
