Do anyone use a good package for saving API usage in Laravel?
We would like to save the API usage for our users and potentially implement a metered billing at some point and are looking for a good solution for saving this.
Imagine for example that we have four endpoints
POST /api/posts
PUT /api/posts
GET /api/posts
GET /api/post/{post}
Then we would like to save when a user requests a post, when they create a post, edit a post and so on.
We could build something for this ourself, but if there is already a package out there that we don't know about then it would be stupid to do so.
I don't know of any handy package but I want to suggest using Middleware to do the counting for you, it abstracts that logic away from your API endpoint controller methods.
If you do build one, you should publish it as a package, I'm sure others would appreciate it :)