tonning/flashable
Composer 安装命令:
composer require tonning/flashable
包简介
A simple trait to flash when model events are fired, like `created`, `updated`, and `saved`.
README 文档
README
A simple trait to flash when model events are fired, like created, updated, and saved.
Using Jeffrey Way's excellent Flash package to actually display the flash messages.
Installation
Begin by pulling in the package through Composer.
composer require tonning/flashable
Then add the trait to the model you want to automatically flash on crud actions.
use Tonning\Flashable\Flashable; class Post extends Model { use Flashable; ... }
Customization
You can specify the name of the model by adding a getModelName method on you model.
public function getModelName() { return 'Blog post'; }
For even more fine grain control you can add a protected property on the model.
protected $flashable = [ 'created' => 'Your blog post have been created. Good job!', 'updated' => 'I hope nobody saw those mistakes...', 'deleted' => 'Be gone blog post!' ]
统计信息
- 总下载量: 6.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-04