Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Events #12

Open
Arcesilas opened this issue Mar 3, 2019 · 2 comments
Open

Events #12

Arcesilas opened this issue Mar 3, 2019 · 2 comments

Comments

@Arcesilas
Copy link
Contributor

Using events would allow user to easily add custom functionalities.

Simple example: when an article is displayed, increment a counter and use this value to select the X most popular articles. They can also be used to notify an admin that an author has published an article, etc.

Back-end events:

  • ArticleIsCreated
  • ArticleIsDeleted
  • ArticleIsModified
  • ArticleIsPublished
  • CategoryIsCreated
  • CategoryIsDeleted
  • CategoryIsModified

Front-end events:

  • ArticleIsDisplayed
  • CategoryIsDisplayed
  • IndexIsDisplayed

I think that only the Request is required to access time, query parameters, IP, etc.

As for my previous suggestions, I can work on this feature and provide a PR.

@saleem-hadad
Copy link
Owner

Great suggestions I really like the idea
I'll try to work on this today
Regarding the ArticleIsDisplayed event, I found this package to calculate the number of views for the models based on the IP but it has Redis as dep.
https://github.com/awssat/laravel-visits

@saleem-hadad
Copy link
Owner

I think ArticleIsDisplayed will be postponed after I recreate the internal architecture of this package to allow external custom packages, then we can add this idea as an optional package like what I did with LaRecipe package

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants