Currently, we are trying to create a system where we cannot vote again until 24 hours after logging in as a double vote prevention function in Ravel.
I would like to create a method called logintime in the model and implement a re-voting prevention process within it.
Ravel Framework 6.18.20
Users Table (History of Last Login)
True if you have logged in for 24 hours using the trinomial operator. If not, return false
However, I gave up because I didn't know it would be 24 hours after processing the collection.laravel
Curbon makes it easy to handle dates and times.Available with Ravel without additional packages
They want to determine if it's 24 hours after logging in, so it's good to use whereBetween 24 hours before now
You can use last_login_at to determine if it is within 24 hours without issuing a query.This uses Carbon's between method
© 2022 OneMinuteCode. All rights reserved.