alive2212/laravel-model-event-service 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alive2212/laravel-model-event-service

Composer 安装命令:

composer require alive2212/laravel-model-event-service

包简介

This package to simplisafe model events to fire some jobs

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.

src/
tests/

Install

Via Composer

$ composer require Alive2212/LaravelModelEventService

Usage

Base Observer Help to create event listener simple

1- Create your own Observer file and locate it into app/Observers

2- Extend it from BaseObserver form this Package

3- Override boot method in your Model what you want to track events

4- Put following code into "boot" of your model after "parent::boot();"

Order2::observe(Order2Observer::class);

5- add what event you want into event service provider with this convention

'App\Events\{Model}{Method}Event' => [
'App\Listeners\{Model}{Method}Listener',
]

6- generate events

7- extend all event with 'BaseModelEvent' or 'BaseModelPivotEvent' and remove all class code

8- get model in listener class with following command

$event->getModel();
$skeleton = new Alive2212\LaravelModelEventService();
echo $skeleton->echoPhrase('Hello, League!');

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email alive2212@yahoo.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固