Download the PHP package sietse85/nova-button without Composer

On this page you can find all versions of the php package sietse85/nova-button. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-button

Laravel Nova 4+ Button

A Nova package for rendering buttons on index, detail and lens views.

Use buttons to trigger backend events, navigate Nova routes or visit links.

example-users

This package is a continuation of dillingham/nova-button.

Created to be compatible with Nova 4.0+

Requirements

What Minimum
PHP >=7.4
Laravel >=8.0
Nova >=4.0

Installation

You can install this package by running the following command:

To publish the config file, run the following command:

Usage

Quick links


Confirm

You can require a confirmation for destructive actions:

Reload

You can reload the page after all events have finished.

If you click multiple buttons, reloading will wait for all buttons to finish.

If an error occurs, the page will not be reloaded.

Action

You can trigger an action now. No ActionFields can be used. Will trigger for current resource only. Handle will be called immediately.

If for some reason the Model for the action is not resolved correctly you can use modelForAction to correct it.

Events

By default, clicking the button will trigger an event via AJAX.

Default event: Sietse85\NovaButton\Events\ButtonClick.

The event will receive the resource model it was triggered from and the key:

You can override the key:

And also the event:

You can listen to the event by creating a listener and registering it in your EventServiceProvider.

Texts

Title

You can set the title attribute for the button:

Label

You can set the label for the button, which is shown on the detail, create and update views:

Index name

You can set the index name for the button, which is shown on the index view as the table header:

Default is set to the button name. You can also pass null to have no index name.

State

Visibility

You can conditionally show the button:

Or, if you only want specific users to see the button:

Of course you can also use Nova's builtin methods, like for authorization or to limit visibility to specific views.

If you want to show a button on the create or update views you can simply use Nova's builtin methods:

Disabled

You can disable the button:

Feedback

When using events, you might want to provide visual feedback to the end user. This is especially useful for long running listeners.

There are 3 events and for each event you can provide the text and style:

Event Text Style
loading ->loadingText('Sending...') ->loadingStyle('grey-outline')
success ->successText('Done!') ->successStyle('success')
error ->errorText('Something went wrong...') ->errorStyle('danger')

The defaults are defined in the config file.

Nova routes

You can also choose to navigate to any Nova route:

It's also possible to use a resource's filters:

Links

You can configure the button to open external links:

Classes

The button uses the following classes that you can style to your liking:

You can also add more classes to a button:

You can also add more classes to the confirm-modal inner-div:

Styles

This package uses tailwind-css classes. The default class used is the link class.

You can define the class the button should use:

The default available classes are as follows:

Fill Outline Link
primary primary-outline primary-link
success success-outline success-link
warning warning-outline warning-link
danger danger-outline danger-link
info info-outline info-link
grey grey-outline grey-link

The passed key refers to one of the classes defined in the config file. You are free to change these classes or add your own.

Examples

Lenses

You can use a button with lenses.

lens-example

First set up the lens:

Next, register a listener for the Sietse85\NovaButton\Events\ButtonClick event in your EventServiceProvider:

To confirm the event and event data used in above functionality, see the Telescope inspection below:

telescope

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of nova-button with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
laravel/nova Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sietse85/nova-button contains the following files

Loading the files please wait ....