laravel-modules icon indicating copy to clipboard operation
laravel-modules copied to clipboard

Add Event Handling and Constants for Module Actions

Open alissn opened this issue 1 year ago • 5 comments

Hi,

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

  • New events added: creating, created, deleting, deleted, used, unused
  • Existing events updated for usage: boot, register, disabling, disabled, enabling, enabled

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.

alissn avatar Jun 30 '24 21:06 alissn

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.

solomon-ochepa avatar Jul 01 '24 05:07 solomon-ochepa

@dcblogdev

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

alissn avatar Jul 02 '24 07:07 alissn

Awesome, thank you!

dcblogdev avatar Jul 02 '24 07:07 dcblogdev

@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?

alissn avatar Jul 02 '24 07:07 alissn

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

dcblogdev avatar Jul 02 '24 08:07 dcblogdev