PHP code example of simonhamp / laravel-stripe-connect

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

    

simonhamp / laravel-stripe-connect example snippets


use SimonHamp\LaravelStripeConnect\Traits\Payable;

class User extends Model
{
    use Payable;

Route::get('/connect', function () {
    if (! auth()->user()->getStripeAccountId()) {
        auth()->user()->createStripeAccount(['type' => 'express']);
    }

    if (! auth()->user()->isStripeAccountActive()) {
        return redirect(auth()->user()->getStripeAccountLink());
    }

    return redirect('dashboard');
})->middleware(['auth']);

auth()->user()->transfer(10000, 'usd');

php artisan migrate