定制 norman-huth/nova-detached-actions 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

norman-huth/nova-detached-actions

最新稳定版本:v1.0.2

Composer 安装命令:

composer require norman-huth/nova-detached-actions

包简介

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

README 文档

README

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.

Install

composer require norman-huth/nova-detached-actions

Usage

Create A Action And Extend DetachedAction Class

php artisan nova:action MyDetachedAction
use NormanHuth\NovaDetachedActions\DetachedAction;

class MyDetachedAction extends DetachedAction

Options

Destructive Action

public function actions(NovaRequest $request): array
{
    return [
        (new MyDetachedAction)->isDestructive()
    ];
}

Add Heroicon Icon

public function actions(NovaRequest $request): array
{
    return [
        (new MyDetachedAction)->icon('users')
    ];
}

Add FontAwesome Icon

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')
    ];
}

Add SVG Icon

public function actions(NovaRequest $request): array
{
    return [
        (new MyDetachedAction)->svgIcon('<svg xmlns="...')
    ];
}

Add Image Icon

public function actions(NovaRequest $request): array
{
    return [
        (new MyDetachedAction)->imageIcon(asset('images/users.png'))
    ];
}

Add HTML Code Icon

public function actions(NovaRequest $request): array
{
    return [
        (new MyDetachedAction)->htmlIcon('YOUR-HTML-CODE')
    ];
}

Add Classes To Button

(new MyDetachedAction)->addButtonClasses(['text-center'])

Set Button Classes

(new MyDetachedAction)->setButtonClasses(['text-center'])

Use Button Style

(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

统计信息

  • 总下载量: 1.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 58
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-07