In CashierRegisterServiceProvider's boot method you may define the plans you need:
useRenokiCo\CashierRegister\CashierRegisterServiceProvideras BaseServiceProvider;useRenokiCo\CashierRegister\Saas;classCashierRegisterServiceProviderextendsBaseServiceProvider{/** * Boot the service provider. * * @returnvoid */publicfunctionboot() {parent::boot();Saas::currency('EUR');Saas::plan('Gold Plan','price_...')->monthly(30)->features([Saas::feature('Seats','seats',5)->notResettable(), ]); }}
Please note that the ::plan method accepts a display name, and the following two parameters are that plan identifiers in either Stripe or Paddle. This will ensure the available plans have unique IDs and they will be processed accordingly when it comes to the billing process:
useRenokiCo\CashierRegister\CashierRegisterServiceProvideras BaseServiceProvider;useRenokiCo\CashierRegister\Saas;classCashierRegisterServiceProviderextendsBaseServiceProvider{/** * Boot the service provider. * * @returnvoid */publicfunctionboot() {parent::boot();Saas::plan('Gold Plan','price_monthly'); }}
Defining yearly plans
By default, yearly plans are not included but you might specify it if you have some:
useRenokiCo\CashierRegister\CashierRegisterServiceProvideras BaseServiceProvider;useRenokiCo\CashierRegister\Saas;classCashierRegisterServiceProviderextendsBaseServiceProvider{/** * Boot the service provider. * * @returnvoid */publicfunctionboot() {parent::boot();Saas::plan('Gold Plan','price_monthly','price_yearly'); }}
Retrieving the plans
useRenokiCo\CashierRegister\Saas;$allPlans =Saas::getPlans();foreach ($allPlans as $plan) { $features = $plan->getFeatures();}
When retrieving a specific plan by Plan ID, you may pass the identifier: