PHP code example of norman-huth / nova-detached-actions
1. Go to this page and download the library: Download norman-huth/nova-detached-actions library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
norman-huth / nova-detached-actions example snippets
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')
];
}
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'])