Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Is Pennant a good idea to apply restrictions according to a chosen plan ?

Hello,

I have to apply restrictions according to the plan chosen by the client.

I have stored the stripe product and price id and I let the superadmin store restrictions in the database according to the product and price id.

Now I want to apply these restrictions.

First I just wanted to load these restrictions in variables available in all the project (for example via a configuration file, I think that it's possible to declare some variables dynamically in a configuration file) and simply use these variables where I need them (views, database query, ...).

I have seen the Pennant package and I'd like to know if it would be a good idea to use it or if it's better for me to load and use the restrictions in some variables.

Here are some examples for the restrictions :

  • number of months to see the history

  • available roles

Thanks for your help.

V

0 likes
3 replies
jaseofspades88's avatar
Level 51

I've done something similar using the Pennant class based approach and it works really well in production.

1 like
jaseofspades88's avatar

Pennant simply caches if the feature is available upon first check, @vincent15000. When using class based approach you can either do database, cache or even configuration value checks!

Please or to participate in this conversation.