1. Go to this page and download the library: Download hulkapps/appmanager 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/ */
use HulkApps\AppManager\app\Events\PlanActivated;
class EventServiceProvider extends ServiceProvider {
protected $listen = [
PlanActivated::class => [
PlanActivatedListener::class,
],
];
}
use HulkApps\AppManager\app\Traits\HasPlan;
class User extends Model
{
use HasPlan;
}
$user->hasPlan(); // If the user has plan or not
$user->planFeatures(); // Return the active plan's features with value
$user->hasFeature($featureSlug); // Return the user has given the feature or not
$user->getFeature($featureSlug); // Return data for a feature
$user->getRemainingDays(); // Calculate the remaining days of the active plan
$user->getPlanData(); // Return plan details
$user->getChargeData(); // Return active and recent cancelled charge
$user->setDefaultPlan($plan_id); // Set default plan_id( plan_id Optional)
use HulkApps\AppManager\Contracts\ShopifyTokenResolver;
class MyTokenResolver implements ShopifyTokenResolver
{
// A token valid right now; renew it here if it is at or near expiry.
public function token(string $shopDomain): ?string { /* ... */ }
// Shopify rejected that token. Return a working replacement, or null.
// The SDK replays the call once, and only if this differs from the rejected one.
public function refresh(string $shopDomain): ?string { /* ... */ }
}
// config/app-manager.php
'shopify_token_resolver' => \App\Services\MyTokenResolver::class,
'shopify_timeout' => 20, // seconds per Shopify call; lower it on serverless hosts
bash
composer dump-autoload
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.