achalj09/editresource

编辑资源按钮

0.0.1 2019-01-22 07:15 UTC

This package is not auto-updated.

Last update: 2024-09-26 09:44:05 UTC


README

在 Laravel Nova 中,当您使用自定义工具创建/编辑/更新自定义页面时,

您可能需要一个带有编辑 SVG 图标的“编辑资源按钮”作为自定义链接字段。

使用以下方法安装

composer require achalj09/editresource

在资源中使用

use Achalj09\Editresource\Editresource;


Editresource::make('Edit','edit')
  ->details([
      'href' => function () {
          return "../../createjobs/{$this->id}/edit";
      },
      'text' => function () {
          return 'edit';
      },
  ])->onlyOnIndex()
  ->canSee(function ($request) {
      return $request->user()->can('Update Jobs', $this);
}),

输出

alt Sample Image