PHP code example of jeanfprado / cashier

1. Go to this page and download the library: Download jeanfprado/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/ */

    

jeanfprado / cashier example snippets


Jeanfprado\Cashier\CashierServiceProvider::class,

'Cashier' => Jeanfprado\Cashier\Support\Facade\Cashier::class,



namespace App;

use Jeanfprado\Cashier\Subscribable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Jeanfprado\Cashier\Contracts\Subscribable as SubscribableContract;


class User extends Model implements SubscribableContract
{
    use Notifiable,
        Subscribable;
    ...
}

 $user->subscribe($plan);

    $billing->markToPaid();
bash
php artisan vendor:publish --provider="Jeanfprado\Cashier\CashierServiceProvider"
bash
php artisan cashier:seed-plans
bash
    php artisan cashier:subscription-check