Reputation: 891
I want to add a loyalty feature in the settings of my application where the user can toggle off
and on
. Is it possible for me to create a table for the toggling? So when it is set to Off, then it updates the db to 0, when on, 1.
When it is 0, i run a section of code which won't include the loyalty program, when it is 1, it runs the code with the loyalty feature?
Is it possible to have something of this sought?
PS: My question may be unclear because it is my very first time trying to implement something of this sought
Upvotes: 0
Views: 44
Reputation: 1707
well, if you need it to each user - the answer would be pretty clear. Just add a new column to users table and mark it off (0 - zero) by default. Set it to one when required.
Then get your user info with $user = Auth::user() like usual and decide what to do and what to show to users based on $user->newcolumnname values.
Upvotes: 1