lundi 3 septembre 2018

Laravel middlware with value from database

I am trying to protect some routes (multiple) with a middlware. Right now it checks (using a mysql query in the middleware file) if a value in the database is either 0 or 1 and allows or denies access to those routes.

The thing I am concerned with, is that on every request on those routes a mysql query is fired. As a requirment I have to deny access to those routes the moment the sql value changes to 0.

Is this the only way to do things or am I missing something?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire