PHP code example of ivalin-venkov / stripe-watcher

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

    

ivalin-venkov / stripe-watcher example snippets


'enabled' => true,

use Illuminate\Support\Facades\Gate;

Gate::define('viewStripeWatcher', function (User $user): bool {
    return $user->is_admin;
});

use StripeWatcher\StripeWatcher\Http\Middleware\CaptureWebhook;

Route::post('/stripe/webhook', WebhookController::class)
    ->middleware(CaptureWebhook::class);
bash
php artisan vendor:publish --tag="stripe-watcher"
bash
php artisan vendor:publish --tag="stripe-watcher-config"
bash
php artisan vendor:publish --tag="stripe-watcher-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="stripe-watcher-views"
bash
php artisan vendor:publish --tag="stripe-watcher-lang"
bash
php artisan vendor:publish --tag="stripe-watcher-assets"
bash
php artisan stripe-watcher:prune
php artisan stripe-watcher:prune --days=7