PHP code example of whilesmart / entitlements-cashier
1. Go to this page and download the library: Download whilesmart/entitlements-cashier library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
whilesmart / entitlements-cashier example snippets
$codes = app(\Whilesmart\EntitlementsCashier\Discounts\PromotionCodes::class);
$codes->create('PILOT20', PromotionCodes::REPEATING, percentOff: 20, months: 3);
$codes->create('ADA50', PromotionCodes::FOREVER, percentOff: 50, for: $owner);
$codes->all();
$codes->stop($id);
$codes->end($id);
php artisan entitlements-cashier:sync-prices