dev-master
9999999-dev这是一个基于toastr的提示框组件
MIT
The Requires
by chensuilong
Wallogit.com
2017 © Pedro Peláez
这是一个基于toastr的提示框组件
Support laravel5.*, (*1)
toastr is a Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended., (*2)
Using Composer, (*3)
composer require csl/toastr
Add the service provider to config/app.php, (*4)
Csl\Toastr\ToastrServiceProvider::class,
Add the Facade in config/app.php, (*5)
'Toastr' => Csl\Toastr\Toastr::class,
jQuery toast, you need to add css and js to your html., (*6)
<link rel="stylesheet" href="http://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css">
{!! Toastr::message() !!}
Toastr::info('foo', 'bar');
Toastr::success('foo', 'bar');
Toastr::warning('foo', 'bar');
Toastr::error('foo', 'bar');
<?php
Route::get('/', function () {
Toastr::success('Hi! this is Toastr', 'Hello', ["positionClass" => "toast-bottom-left"]);
return view('welcome');
});
<!DOCTYPE html>
<html>
<head>
<title>Laravel</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css">
</head>
<body>
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>
{!! Toastr::message() !!}
</body>
</html>
, (*7)
If you need to modify the flash message partials, you can run:, (*8)
php artisan vendor:publish
to publish the config file for config/toastr.php., (*9)
You can see toastr's documentation to custom your need., (*10)
这是一个基于toastr的提示框组件
MIT