reminder-for-laravel5.3
Inspired by laracasts flash, (*1)
中文, (*2)
install
Using Composer, (*3)
composer require g9zz/reminder
Add the service provider to config/app.php, (*4)
G9zz\Reminder\ReminderServiceProvider::class,
Optionally include the Facade in config/app.php if you'd like., (*5)
'Reminder' => G9zz\Reminder\ReminderFacade::class,
You can use reminder() function available., (*6)
Dependencies
jQuery toast, you need to add css and js to your html., (*7)
Basic
You should add {!! Reminder::message() !!} to your html., (*8)
Then., (*9)
-
Reminder::info('foo', 'bar', []);, (*10)
-
Reminder::success('foo', 'bar', []);, (*11)
-
Reminder::warning('foo', 'bar', []);, (*12)
-
Reminder::error('foo', 'bar', []);, (*13)
-
reminder()->info('foo', 'bar', []);, (*14)
<?php
Route::get('/', function () {
Reminder::success('Hi! this is Reminder', 'Hello', ["positionClass" => "toast-bottom-right"]);
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>
<div class="container">
<div class="content">
<div class="title">Laravel 5</div>
</div>
</div>
<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>
{!! reminder()->message() !!}
</body>
</html>
, (*15)
Options
You can set custom options for Reminder. Run:, (*16)
php artisan vendor:publish
to publish the config file for reminder., (*17)
You can see toastr's documentation to custom your need., (*18)
MIT