shawnsandy / toasts
一个用于在 Laravel 中创建 Toast 提示的包
v0.1.10
2016-11-04 11:44 UTC
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2024-09-14 19:26:00 UTC
README
一个用于在 Laravel 中创建 Toast 提示的简单包。
安装
通过 Composer
$ composer require shawnsandy/toasts
将 app.php 添加到您的 config/app.php
提供者
'providers' => [ ShawnSandy\Toasts\ToastProvider::class, ];
外观
'aliases' => [ 'Toast' => ShawnSandy\Toasts\App\ToastsFacade::class, ]
用法
在控制器中创建闪存消息
// Display a info alert toastInfo( 'Information is very valuable' ); // Display a success alert toastSuccess( 'A success alert' ); // Display a warning alert toastWarning( 'A warming alert' ); // Display a danager alert toastDanger( 'Information is very valuable' ); // Display a alert with title toastInfo( 'Information is very valuable', 'Alert title' );
添加到您的视图中
{!! Toast::toastrJs() !!} @include('toast::toastr.js', ['options' => ['timeOut' => 5000]])
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
测试
$ composer test
贡献
请参阅 CONTRIBUTING 和 CONDUCT 了解详细信息。
安全
如果您发现任何与安全相关的问题,请通过电子邮件 shawnsandy04@gmail.com 联系,而不是使用问题跟踪器。
致谢
- Shawn Sandy
- [所有贡献者][link-contributors]
许可
MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。