whossun/laravel-toastr

toastr.js for laravel 5.2
2,837 4
Install
composer require whossun/laravel-toastr
Latest Version:1.0.1
PHP:>=5.5.0
License:MIT
Last Updated:Feb 23, 2017
Links: GitHub  ·  Packagist
Maintainer: whossun

laravel-toastr

install

Using Composer

composer require whossun/laravel-toastr

Add the service provider to config/app.php

Whossun\Toastr\ToastrServiceProvider::class,

Optionally include the Facade in config/app.php if you'd like.

'Toastr'  => Whossun\Toastr\Facades\Toastr::class,

Options

You can set custom options for Reminder. Run:

php artisan vendor:publish

to publish the config file for toastr.

You can see toastr's documentation to custom your need.

You can use toastr() function available.

Dependencies

jQuery toast, you need to add css and js to your html.

Basic

  • Toastr::info('message', 'title', ['options']);

  • Toastr::success('message', 'title', ['options']);

  • Toastr::warning('message', 'title', ['options']);

  • Toastr::error('message', 'title', ['options']);

  • Toastr::clear();

  • Toastr()->info('message', 'title', ['options']);

<?php

Route::get('/', function () {
    Toastr::success('Messages in here', 'Title', ["positionClass" => "toast-top-center"]);

    return view('welcome');
});

Then

You should add {!! Toastr::message() !!} to your html.

<!DOCTYPE html>
<html>
    <head>
        <title>Laravel</title>
        <link rel="stylesheet" href="http://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css">
    </head>
    <body>
        <div class="container">
            <div class="content">
                <div class="title">Laravel 5</div>
            </div>
        </div>
		<script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
        <script src="http://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>
        {!! Toastr::message() !!}
    </body>
</html>

MIT

Related Packages

nilsenj/toastr-5.1-laravel

toastr.js for Laravel 5.1/5.2 easy notification like growl for example

33,965 6
brian2694/laravel-toastr

toastr.js for Laravel

764,630 131
oriceon/toastr-5-laravel

Easy toastr notifications for Laravel 5

496,620 79
narutimateum/toastr-5.2-laravel

toastr.js for Laravel 5.2 easy notification like growl for example

37,567 13
nilsenj/toastr-laravel

toastr.js for Laravel 5.* easy notification like growl for example

9,021 7