lundi 28 novembre 2016

How to implement subscription plan restrictions? (php)

Let's say we have a simple SAAS that offers two types of plans. For example, in the cheapest plan you can create 20 lists at maximum and in the next plan you can create up to 50 lists. This is just one feature of the pricing model. Assuming the pricing model is based on 4-5 different features for each plan, what would be a good practice to check and enforce those restrictions?

I guess, the (messy) way would be to add a bunch of 'ifs' in different points, eg: if $user->plan->limitReached, do this etc.

Maybe another approach would be to throw some kind of events on user actions and handle the checks in a more 'centralized' way? What are your thoughts on this scenario? Any suggestions would be appreciated. Thank you



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2frDxMV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire