Download the PHP package jantinnerezo/livewire-alert without Composer

On this page you can find all versions of the php package jantinnerezo/livewire-alert. 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 livewire-alert

Livewire Alert

Build Status Latest Stable Version Total Downloads License

Livewire Alert is a simple alert utility package designed to seamlessly integrate with your Livewire components. Under the hood, it utilizes SweetAlert2, offering you the functionality of SweetAlert2 without the need for any custom Javascript.

Interactive Demo

Check the interactive demo here: https://livewire-alert.jantinnerezo.com

Contribute to interactive demo

Do you have any ideas in mind that you can add to the interactive demo? Fork and submit a PR here: https://github.com/jantinnerezo/livewire-alert-demo

Installation

You can install the package via composer:

Next, add the scripts component to your template after the @livewireScripts.

SweetAlert2 script is not included by default so make sure you include it before livewire alert script.

You can also manually include the script by publishing livewire-alert.js

And then in your view you can include the published script instead of including inline script with <x-livewire-alert::scripts /> component.

If you go this path, make sure to include the <x-livewire-alert::flash /> right after the livewire-alert script if you still want the flash feature.

Requirements

This package is meant to use with Livewire components. Make sure you are using it with Livewire projects only.

Usage

You can use livewire alert by using the LivewireAlert trait.

Displaying different alert icons.

The default alert behaviour is a toast notification.

Disabling toast notification alert treatment.

Positioning Alert

List of the following alert positions:

Buttons

SweetAlert2 has 3 buttons that is not shown by default.

To show confirm button, simply pass the showConfirmButton to alert configuration and set it to true.

Change confirm button text:

Adding event when confirm button is clicked. First create a function that will be fired when confirm button is clicked:

Add to it event listeners array to register it.

Or

And then pass it to onConfirmed key of the alert configuration.

You can also pass a parameter to the event to get the alert response.

Useful when you need to get the value of the input inside the alert.

Just do the same thing to show deny and cancel button. Just create a function for each button and register it to event listeners.

Make sure to set showDenyButton and showCancelButton to true.

Emit events to only specific component. Instead of passing the listener directly to the event, pass an array with component and listeners keys.

Don't want to define extra button configuration every time you show alert confirmation? Use the confirm method instead.

You can always override default confirm settings just tweak the configuration.

Flash Notification

You can also use alert as a flash notification. You can pass the redirect route on the fourth parameter, redirects to / by default.

Configuration

Override default alert config by publishing the livewire-alert.php config file.

Customizations

You can customize alert style by passing your custom classes, works perfectly with TailwindCSS

For more details about customization and configuration please check SweetAlert2

Contributors

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

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


All versions of livewire-alert with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
livewire/livewire Version ^3.0
illuminate/support Version ^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0|^11.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 jantinnerezo/livewire-alert contains the following files

Loading the files please wait ....