PHP code example of stratedge / visa

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

    

stratedge / visa example snippets




namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Stratedge\Visa\Visa;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // Configure UUIDs for OAuth client IDs
        Visa::enableClientUUIDs();
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}


protected $routeMiddleware = [
    'auth.first-party' => \Stratedge\Visa\Http\Middleware\CheckFirstPartyClient::class,
];



namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Stratedge\Visa\Visa;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // Do not use the standard Passport error handling
        Visa::disablePassportErrorHandling();
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}




namespace App\Providers;

use Stratedge\Visa\VisaServiceProvider as BaseProvider;

class VisaServiceProvider extends BaseProvider
{
    /**
     * Enables any additional custom grants when overloaded.
     *
     * @param  AuthorizationServer $server
     * @return void
     */
    public function enableCustomGrants(AuthorizationServer $server)
    {
        $server->enableGrantType(/* Register custom grant here */);
    }
}