1. Go to this page and download the library: Download rlaravel/plans 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/ */
rlaravel / plans example snippets
'providers' => [
/**
* Third Party Service Providers...
*/
RLaravel\Plans\Providers\PlansServiceProvider::class,
];
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use RLaravel\Plans\Contracts\PlanSubscriberInterface;
use RLaravel\Plans\Traits\PlanSubscriber;
class User extends Authenticatable implements PlanSubscriberInterface
{
use PlanSubscriber;
use RLaravel\Plans\Models\PlanSubscription;
// Obtenga suscripciones por plan:
$subscriptions = PlanSubscription::byPlan($plan_id)->get();
// Obtener suscripción por usuario:
$subscription = PlanSubscription::byUser($user_id)->first();
// Obtenga suscripciones con prueba que termina en 3 días:
$subscriptions = PlanSubscription::findEndingTrial(3)->get();
// Obtenga suscripciones con prueba finalizada:
$subscriptions = PlanSubscription::findEndedTrial()->get();
// Obtenga suscripciones con período que termina en 3 días:
$subscriptions = PlanSubscription::findEndingPeriod(3)->get();
// Obtenga suscripciones con período finalizado:
$subscriptions = PlanSubscription::findEndedPeriod()->get();
sh
$ php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.