PHPackages                             gobrightspot/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. gobrightspot/nova-detached-actions

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

gobrightspot/nova-detached-actions
==================================

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

1.1.1(5y ago)1691.3M↑23.9%59[8 issues](https://github.com/gobrightspot/nova-detached-actions/issues)[4 PRs](https://github.com/gobrightspot/nova-detached-actions/pulls)3MITVuePHP &gt;=7.1.0

Since May 8Pushed 3y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (18)Used By (3)

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

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

[![Status: ABANDONED](https://camo.githubusercontent.com/06b5dc042c0a2ce9d829af066b4365863b3fa2c107b1669e8c98b3cf0b127f87/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d4142414e444f4e45442d7265642e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/06b5dc042c0a2ce9d829af066b4365863b3fa2c107b1669e8c98b3cf0b127f87/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d4142414e444f4e45442d7265642e7376673f7374796c653d666c6174)[![No Maintenance Intended](https://camo.githubusercontent.com/d904056147052e22d8e1c7f46bb50293ed2aeb4c43ead9a2d0cf7a48b46d0562/687474703a2f2f756e6d61696e7461696e65642e746563682f62616467652e737667)](http://unmaintained.tech/)

Deprecation Notice ⚠️
---------------------

[](#deprecation-notice-warning)

> GoBrightspot is no longer maintaining this project. Please fork it to continue development.

Intro
-----

[](#intro)

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.

⚠️ Also, keep in mind, pivot actions are not supported and have not been tested.

[![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 gobrightspot/nova-detached-actions
```

The tool will be automatically registered via the `ToolServiceProvider`

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 `Brightspot\Nova\Tools\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`.

By default, the detached action will only appear on the Index Toolbar.

If you want to also show the action on the resource index view (when users select a row with a checkbox), set the `$public $showOnIndex = true;`If you want to also show the action on the resource detail view (when user selects the action from the dropdown), set the `$public $showOnDetail = true;`

Here's a full example:

```
