Dynamic Setting
Use Dynamic Settings for your application
Dynamic Setting is quite useful when it comes to:
Update & retrieve values dynamically (eg: fee percentage, fee amount, site name, description,...)
Canary release (you turn on the new feature for some users before rolling it out to all users)
Enable feature A for user X
Enable feature B for user Y
...
and so much more
Requirements
By default, ShipSaaS Ready will create a global setting record for you. You need to set some configurations first before using it.
To update settings, check out the:
Global Setting Usage
To get a global setting, you can use this helper function:
Alternatively, you can do this (OOP way):
Specific-Model Usage
Your model needs to use this trait:
To get the setting, simply use the helper method getSetting
:
Multi-Level Setting
Yes, 2-level, put it simply here:
If your model has the setting => return from model
If the global setting has the setting => return from global setting
Else: return fallback
You can use this method to achieve that.
Shortage Cache
Yes, by default, SaaS Ready will always do the shortage cache (per request), to avoid redundant queries to the database.
If you wish not to use that, set this configuration to false from your saas-ready.php
Last updated