PHP code example of mattoid / flarum-ext-store
1. Go to this page and download the library: Download mattoid/flarum-ext-store 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/ */
mattoid / flarum-ext-store example snippets
(new StoreExtend('Unique KEY of the product, must not overlap with other extensions'))
// Register product information
->addStoreGoods(Goods::class)
// Register pre-validation
->addValidate(Validate::class)
// Register business logic of the product
->addAfter(After::class)
// Product invalidation logic
->addInvalid(Invalid::class)
// Product usage logic
->addEnable(Enable::class);
sh
composer update mattoid/flarum-ext-store:"*"
php flarum migrate
php flarum cache:clear