As the topic is.
The interface limits the access times of the same user (device)
Since the label of the problem is “inside”
Laravel, then the ready-made solution, I recommend,https://github.com/dingo/apiThis package has a feature
Rate Limiting, should be what you are looking for.
If you want to implement it yourself, it is also simple to use [user_id plus unique device code] as the primary key, save the access times in redis, record the access times, and then the specific frequency and number will depend on your implementation strategy.