2017 © Pedro Peláez
 

library laravel-sweet-alert

Laravel package to show beautiful flash message

image

riazxrazor/laravel-sweet-alert

Laravel package to show beautiful flash message

  • Friday, March 2, 2018
  • by riazXrazor
  • Repository
  • 2 Watchers
  • 1 Stars
  • 724 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 12 Versions
  • 7 % Grown

The README.md

LaravelSweetAlert

GitHub Author GitHub release GitHub license GitHub issues, (*1)

StyleCI, (*2)

Laravel package to show beautiful flash message. Its basically a laravel wrapper for the beautiful and very good and useful jquery plugin SweetAlert2 . Using SweetAlert2 : 7.13.0, (*3)

Installation

Open composer.json and add this line below., (*4)

{
    "require": {
        "riazxrazor/laravel-sweet-alert": "^1.2.0"
    }
}

Or you can run this command from your project directory., (*5)

composer require riazxrazor/laravel-sweet-alert

Configuration

Open the config/app.php and add this line in providers section., (*6)

Riazxrazor\LaravelSweetAlert\LaravelSweetAlertServiceProvider::class,

add this line in the aliases section., (*7)

'LaravelSweetAlert' => Riazxrazor\LaravelSweetAlert\LaravelSweetAlert::class

Publish public assets by running this command., (*8)

php artisan vendor:publish --tag=public --force

Place this blade directive at the end before </body> section of the html of layout blade template, (*9)

@LaravelSweetAlertJS

Usage

You can use the function like this., (*10)



// in the controller method \LaravelSweetAlert::setMessageSuccess("flash message") \LaravelSweetAlert::setMessageError("error flash message") \LaravelSweetAlert::setMessageSuccessConfirm("flash message") \LaravelSweetAlert::setMessageErrorConfirm("error flash message") // for more customization LaravelSweetAlert::setMessage([ 'title' => 'Successful', 'text' => $text, 'timer' => 2000, 'type' => 'success', 'showConfirmButton' =>false ]); \LaravelSweetAlert::setMessage([ 'title' => 'Auto close alert!', 'text' => 'I will close in 5 seconds.', 'timer' => 5000, 'onOpen' => '() => { swal.showLoading() }', ], // second argument array of js function each element will be a then to swal ['(result) => { if ( // Read more about handling dismissals result.dismiss === swal.DismissReason.timer ) { console.log("I was closed by the timer") } }'], // third argument is a catch function to the promise of swal '(e)=>console.log(e)');

when the when is redirected to another route a beautiful flash message appears, (*11)

for more customization options please refer to SweetAlert2 , just pass the js object as associative array in the setMessage method., (*12)

The Versions

02/03 2018

dev-master

9999999-dev

Laravel package to show beautiful flash message

  Sources   Download

MIT GPL-3

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

02/03 2018

dev-analysis-qvGxRE

dev-analysis-qvGxRE

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

02/03 2018

1.2.1

1.2.1.0

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

02/03 2018

dev-analysis-XVZ4x3

dev-analysis-XVZ4x3

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

01/03 2018

dev-analysis-zOZpOP

dev-analysis-zOZpOP

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

01/03 2018

1.2.0

1.2.0.0

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

01/03 2018

1.1.3

1.1.3.0

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

27/01 2018

1.1.2

1.1.2.0

Laravel package to show beautiful flash message

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

by Riaz Laskar

27/01 2018

1.1.1

1.1.1.0

Laravel package to show beautiful flash message

  Sources   Download

MIT

by Riaz Laskar

01/03 2017

dev-analysis-zdoNe7

dev-analysis-zdoNe7

Laravel package to show beautiful flash message

  Sources   Download

GPL-3

by Riaz Laskar

01/03 2017

1.1.0

1.1.0.0

Laravel package to show beautiful flash message

  Sources   Download

GPL-3

by Riaz Laskar

26/02 2017

1.0.0

1.0.0.0

Laravel package to show beautiful flash message

  Sources   Download

GPL-3

by Riaz Laskar