D
D
Danila5342020-11-22 23:04:03
Laravel
Danila534, 2020-11-22 23:04:03

How to create temporary roles on the site?

Good evening,

I have created a form in which a user of my site can use the purchase of an improved role...
This happens due to a request to the database via InsertID )) Can

you please tell me how to implement temporary roles on the site? For example, a role for a period of 1 month, after which it should automatically disappear ...

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jazzus, 2020-11-23
@jazzus

Judging by the questions, the most difficult way)
Add an activity date field. Bought for a month, write to active_at = now()->addMonth()
Check using authorization policies . rule
$enity->active_at >= now()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question