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)