Download the PHP package synergitech/laravel-sweetalert without Composer
On this page you can find all versions of the php package synergitech/laravel-sweetalert. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download synergitech/laravel-sweetalert
More information about synergitech/laravel-sweetalert
Files in synergitech/laravel-sweetalert
Package laravel-sweetalert
Short Description A PHP package to show Sweet Alerts with the Laravel Framework
License MIT
Informations about the package laravel-sweetalert
Laravel SweetAlert
please note this package has been abandoned, please use the original package for identical functionality or our replacement package for more flexible functionality
This package integrates Twig with the standard Laravel 5 view framework. The package is based on Easy Sweet Alert Messages for Laravel by Uziel Bueno but has been modified and refactored for our requirements.
Install
First, install the package using Composer:
Please note that this package works only alongside SweetAlert.
Usage
Facade
First, import the Alert facade into your controller.
Then, use the facade methods to add your message.
Alert::message('Message', 'Optional Title');
Alert::basic('Basic Message', 'Mandatory Title');
Alert::info('Info Message', 'Optional Title');
Alert::success('Success Message', 'Optional Title');
Alert::error('Error Message', 'Optional Title');
Alert::warning('Warning Message', 'Optional Title');
Helper Function
The helper supports the same methods as the facade.
alert()->message('Message', 'Optional Title');
alert()->basic('Basic Message', 'Mandatory Title');
alert()->info('Info Message', 'Optional Title');
alert()->success('Success Message', 'Optional Title');
alert()->error('Error Message', 'Optional Title');
alert()->warning('Warning Message', 'Optional Title');
alert()->basic('Basic Message', 'Mandatory Title')->autoclose(3500);
For a generic alert, you can just use alert('Message')
, which has the same outcome as alert()->message('Message')
.
Rendering
Blade
Twig
The sweetalert.alert
session key contains a JSON configuration object which can be passed directly to SweetAlert.