jobmetric / laravel-event-system
This is a event system management package for Laravel that you can use in your projects.
Requires
- php: >=8.0.1
- jobmetric/laravel-package-core: ^1.12
- laravel/framework: >=9.19
This package is auto-updated.
Last update: 2024-12-19 17:28:08 UTC
README
Event System for laravel
The EventSystem package provides an easy-to-use system for managing custom events and their listeners in Laravel. It allows you to manage the status of events within your application. This package is highly flexible and integrates seamlessly with Laravel's built-in event system.
Install via composer
Run the following command to pull in the latest version:
composer require jobmetric/laravel-event-system
Documentation
Before doing anything, you must migrate after installing the package by composer.
php artisan migrate
How is it used?
Some programs need to add listeners to the system when they are installed, and these listeners are lost when they are removed. Using the following methods, we can add and subtract these tasks in the system.
Add Event
addEventSystem('event name', event_class::class, listener_class::class, 'optional description');
The
event name
is the name of the event that you want to add to the system and must be unique.The
event_class
andlistener_class
must be the full path of the class.The
optional description
is optional and is used to describe the event.
Remove Event
removeEventSystem('event name');
The
event name
is the name of the event that you want to remove from the system.
Events
This package contains several events for which you can write a listener as follows
Contributing
Thank you for considering contributing to the Laravel Event System! The contribution guide can be found in the CONTRIBUTING.md.
License
The MIT License (MIT). Please see License File for more information.