2017 © Pedro Peláez
 

library laravel-model-event-service

This package to simplisafe model events to fire some jobs

image

alive2212/laravel-model-event-service

This package to simplisafe model events to fire some jobs

  • Monday, April 30, 2018
  • by Alive2212
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

LaravelModelEventService

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

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., (*2)

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., (*3)

src/
tests/

Install

Via Composer, (*4)

``` bash $ composer require Alive2212/LaravelModelEventService, (*5)


## 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();" ```php Order2::observe(Order2Observer::class);

5- add what event you want into event service provider with this convention ``` php 'App\Events{Model}{Method}Event' => [ 'App\Listeners{Model}{Method}Listener', ], (*6)

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
```php
$event->getModel();

``` php $skeleton = new Alive2212\LaravelModelEventService(); echo $skeleton->echoPhrase('Hello, League!');, (*7)


## Change log Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Testing ``` bash $ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*8)

Security

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

Credits

License

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

The Versions

30/04 2018

dev-master

9999999-dev https://github.com/Alive2212/LaravelModelEventService

This package to simplisafe model events to fire some jobs

  Sources   Download

MIT

The Requires

 

The Development Requires

alive2212 laravelmodeleventservice

30/04 2018

1.0.0

1.0.0.0 https://github.com/Alive2212/LaravelModelEventService

This package to simplisafe model events to fire some jobs

  Sources   Download

MIT

The Requires

 

The Development Requires

alive2212 laravelmodeleventservice