lancewan/laravel5-sweetalert

sweetalert.js for laravel5.2
26 1
Install
composer require lancewan/laravel5-sweetalert
Latest Version:v1.0.1
PHP:>5.5.9
License:MIT
Last Updated:Apr 2, 2016
Links: GitHub  ·  Packagist
Maintainer: iwanli

SweetAlert.js for laravel5

Quick Installation

Begin by installing the package through Composer.

composer require lancewan/laravel-sweetalert=~1.0

Or add this code to composer.json file:

"lancewan/laravel5-sweetalert":"~1.0"

Once this operation is complete, simply add both the service provider and facade classes to your project's config/app.php file:

Service Provider

Lance\Sweet\SweetAlertServiceProvider::class,

Facade

'Sweet' => Lance\Sweet\Facade\Sweet::class,

Run php artisan vendor:publish

And that's it!

Usage

Usage is simple. Before redirecting to another page, simply call on Flash to set your desired Sweet message. There are a number of methods to assign different levels of priority (info, success, warning, and error).

Success

Sweet::success($message, $title = '', $options = []);

Info

Sweet::info($message, $title = '', $options = []);

Warning

Sweet::warning($message, $title = '', $options = []);

Error

Sweet::error($message, $title = '', $options = []);

Rendering

Just add this code to your blade template file:

{!! Sweet::render() !!}

Config

set the sweetAlert options in config/sweet.php , available options => sweetAlert.js

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

641,106,524 9,700
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

502,645,077 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

418,291,778 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP License
v1.0.1 >5.5.9 MIT
1.0.0 >5.5.9 MIT