We have build a package that will make it issue to add a button to your Nova Resources. This button is hidden by default when creating a resource.

Screenshot 2022-07-11 at 11.26.31.png

Installation

This Laravel Nova Field package can be installed via Composer

composer require marshmallow/button-field

Usage

By default this package will resolve the link from the column you provide when calling the make method. By calling the resolveUsing method you can return your own generated link to the button.

use Marshmallow\\ButtonField\\ButtonField;

ButtonField::make('Certificate')->resolveUsing(function () {
    return '___YOUR_LINK_GOES_HERE___';
}),

Methods

button()

When you call the button method, this will return a default Laravel Nova Button. This should have the same styling as the Update and Update & Continue Editing buttons in your Nova installation. This method is called by default so this behaviour should be available out of the box.

$button_field->button();

target()

You can call the target method to change the behaviour of your button.

$button_field->target('_blank'); // DEFAULT
$button_field->target('_self');

download()