Yes, it is possible to add your custom action to the replicate dropdown. You can achieve this by modifying the resource controller's actions() method.
Here's an example code snippet that demonstrates how to add a custom action to the replicate dropdown:
use Laravel\Nova\Actions\Action;
class YourResourceController extends ResourceController
{
/**
* Get the actions available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Support\Collection
*/
public function actions(Request $request)
{
$actions = parent::actions($request);
$actions->push(
(new YourCustomAction)->canSee(function ($request) {
return true; // Add your authorization logic here
})
);
return $actions;
}
}
In the above code, we're extending the actions() method of the resource controller and adding our custom action to the actions collection. We're also using the canSee() method to add authorization logic to our action.
Once you've added this code to your resource controller, you should see your custom action in the replicate dropdown when you click on the three dots on the index page.
I hope this helps! Let me know if you have any questions.