Downloads
Stars
Version
This package is no longer necessarily required. Since Laravel Nova v4.24.0,
there are
now also standalone actions:
Registering Actions: Standalone Actions
The idea based on jeffersonsimaogoncalves/nova-detached-actions by Jefferson Simão Gonçalves.
composer require norman-huth/nova-detached-actions
php artisan nova:action MyDetachedAction
use NormanHuth\NovaDetachedActions\DetachedAction;
class MyDetachedAction extends DetachedAction
public function actions(NovaRequest $request): array
{
return [
(new MyDetachedAction)->isDestructive()
];
}
public function actions(NovaRequest $request): array
{
return [
(new MyDetachedAction)->icon('users')
];
}
FontAwesome is NOT included!
You can optional install Font Awesome free with php artisan nova-package:font-awesome
.
public function actions(NovaRequest $request): array
{
return [
(new MyDetachedAction)->faIcon('fa-solid fa-user')
];
}
public function actions(NovaRequest $request): array
{
return [
(new MyDetachedAction)->svgIcon('<svg xmlns="...')
];
}
public function actions(NovaRequest $request): array
{
return [
(new MyDetachedAction)->imageIcon(asset('images/users.png'))
];
}
public function actions(NovaRequest $request): array
{
return [
(new MyDetachedAction)->htmlIcon('YOUR-HTML-CODE')
];
}
(new MyDetachedAction)->addButtonClasses(['text-center'])
(new MyDetachedAction)->setButtonClasses(['text-center'])
(new MyDetachedAction)->setButtonStyle('primary')
The default style ist primary
. Available are primary
, danger
, success
and warning
.
You can publish the config file and change themes:
php artisan vendor:publish --provider=NormanHuth\NovaDetachedActions\ToolServiceProvider