nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.56k stars 969 forks source link

Add Event Handling and Constants for Module Actions #1883

Closed alissn closed 3 months ago

alissn commented 4 months ago

Hi,

In this pull request, I have added events for various actions and created a constant ModuleEvent to manage event names.

This pull request depends on #1879, as provider files are registered with a single file. It's important to add a listener to clear the manifest file after certain actions.

Thanks.

solomon-ochepa commented 4 months ago

Hi,

In this pull request, I have added events for various actions and created a constant ModuleEvent to manage event names.

  • New events added: create, delete, used, unused

Nice feature, but why not use "creating" & "created" instead of "create" and "deleting" & "deleted" instead of "delete"?

Events are usually written in present continuous and past tense.

alissn commented 4 months ago

@dcblogdev

add new event creating, created, deleting, deleted and update tests.

dcblogdev commented 4 months ago

Awesome, thank you!

alissn commented 4 months ago

@dcblogdev

Do you think it is necessary to change boot to booting, booted, and register to registering, registered?

These events may be used in projects, and changing them could cause problems.

Also, used and unused don't need to be split into two events. Do you agree?

dcblogdev commented 4 months ago

I agree, lets not change those as you say others could be using them already.