Package Data | |
---|---|
Maintainer Username: | LaravelChen |
Maintainer Contact: | 848407695@qq.com (LaravelChen) |
Package Create Date: | 2017-03-12 |
Package Last Update: | 2017-03-17 |
Home Page: | |
Language: | HTML |
License: | MIT |
Last Refreshed: | 2024-11-26 15:22:33 |
Package Statistics | |
---|---|
Total Downloads: | 959 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 37 |
Total Watchers: | 3 |
Total Forks: | 6 |
Total Open Issues: | 0 |
整个package采用了Laravel内置的
Illuminate\Session\Store
中的一次性请求flash函数. 显示视图的方式有三种,图中可以看到.(安装的时候最好开启vpn,因为给有人反映国内镜像好像安装不了,所以说用国外的composer的镜像吧!)
composer require laravelchen/myflash
config/app.php
添加provider和alias'providers' => [
LaravelChen\MyFlash\MyFlashProvider::class,
];
'aliases' => [
'MyFlash'=>LaravelChen\MyFlash\MyFlash::class,
];
public function index()
{
MyFlash::success('邮件已发!请查收邮件!');
return Redirect::home();
}
myflash()
这种辅助函数的形式message
视图@include('myflash::notification')
或者
@include('myflash::top-message')
或者
@include('myflash::bottom-message')
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/jquery/2.1.0/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<h1 class="text-center">Hello World</h1>
<script src="//cdn.bootcss.com/jquery/2.1.0/jquery.min.js"></script>
@include('myflash::notification')
</body>
</html>
php artisan vendor:publish
resources/views/vendor/myflash
目录下最后感谢mercuryseries和Jeffrey Way的package!