PHPackages                             digital-creative/nova-detached-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. digital-creative/nova-detached-actions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

digital-creative/nova-detached-actions
======================================

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

v1.1.1(6y ago)417.0k↓50%MITVuePHP &gt;=7.1.0

Since May 8Pushed 6y ago2 watchersCompare

[ Source](https://github.com/dcasia/nova-detached-actions)[ Packagist](https://packagist.org/packages/digital-creative/nova-detached-actions)[ RSS](/packages/digital-creative-nova-detached-actions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (5)Used By (0)

Laravel Nova Detached Actions Tool
==================================

[](#laravel-nova-detached-actions-tool)

A Laravel Nova tool to allow for placing actions in the Nova toolbar, detached from the checkbox selection mechanism.

⚠️ Keep in mind, since the action is detached from the row selection checkboxes in the resource table, you will not have a collection of models to iterate over. Detached actions are intended to be independent of the selection in the table.

[![screenshot](https://camo.githubusercontent.com/e79bd299ae4f076f731acc8f4de9629163da4b725e1c53578d14b7ed3e6bc761/68747470733a2f2f692e696d6775722e636f6d2f533847724e46492e706e67)](https://camo.githubusercontent.com/e79bd299ae4f076f731acc8f4de9629163da4b725e1c53578d14b7ed3e6bc761/68747470733a2f2f692e696d6775722e636f6d2f533847724e46492e706e67)

Installation
------------

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require digital-creative/nova-detached-actions
```

Usage
-----

[](#usage)

Create a custom Nova Action file:

```
php artisan nova:action ExportUsers
```

Instead of extending the `ExportUsers` class with the `Laravel\Nova\Actions\Action` class, swap it with the `DigitalCreative\DetachedActions\DetachedAction` class.

Since we won't receive a collection of `$models`, you can remove the variable from the `handle` method, so that the signature is `public function handle(ActionFields $fields)`.

You can also customize the button label, by overriding the `label()` method. If you do not override the label, it will 'humanize' the class name, in the example `ExportUsers` would become `Export Users`.

Here's a full example:

```
