Problem was totally unrelated and was a dumb mistake by me. Please ignore this! Thanks
Aug 13, 2019
1
Level 2
Comparing Dates in Where Clause (Twist: date stored at string)
I've got a model that has a column: date_revoked (this is stored as a string)
After this date is passed, a user is no longer supposed to be able to access a certain page.
I'd like to restrict this access in the controller.
Currently, I can do a janky partial fix by putting this inside of a foreach in my view
@if(strtotime($filmShareIn->date_revoked) >= strtotime(date('Y-m-d')))
But when I try the following in the controller, I get no filtering:
->where('date_revoked', '>=', Carbon::now())
I know I may have really just screwed up by storing it as a string, but if anyone can get me out of this jam, it is my friends at Laracasts.
Thanks!
Level 2
Please or to participate in this conversation.