larapack / hooks

Hooks is a extension system for your Laravel application.
https://larapack.io
MIT License
219 stars 15 forks source link

Hooks Setup Revision #24

Closed akazorg closed 6 years ago

akazorg commented 6 years ago

This is a draft for revising the Hooks Setup Process, after a debate on this subject.

I'm not sure how to handle the Enable/Disable. The initial idea was to control this by loading (or not) the Hook Service Provider, but I think we need to load it in order to use routines enable/disable.

Maybe any of you wizards have an idea on this? Ping: @marktopper, @fletch3555, @tnylea

Setup Process

  1. Install Hook 1.1 Download hook 1.2 Load Hook Service Provider 1.3 Run Migrations, Seeders and publish assets

  2. Enable Hook ???

  3. Disable Hook ???

  4. Uninstall Hook 4.1 Prompt User for deleting data 4.2 Un-migrate and delete data

Thank you.

marktopper commented 6 years ago

How about this?

Install Hook

Enable Hook

Disable Hook

Uninstall

Besides that, I will be adding some more options to the hooks view including buttons like:

The power of having the enable/disable option is for the developer to easily disable any hook when debugging some issue. I personally think it would be a nice idea to still have the the enable/disable option.

I was thinking about handling this by making a separate HookDataProvider which is almost like a service provider, but only with the options supported by the hook system. This HookDataProvider would include seeders, assets and migrations to run along with a rollback method to un-seed, un-migrate and un-publish assets.

akazorg commented 6 years ago

HookDataProvider will do the trick, that's awesome. Please do it! I'm looking forward to test it!

Then, all hooks will implement that feature, and we have a solid Hook system!

Looks perfect.