PHP code example of jirkavrba / cvut-socialite-provider

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

    

jirkavrba / cvut-socialite-provider example snippets


return [
    // Other services
    'cvut' => [
        'client_id'     => env('CVUT_CLIENT_ID'),
        'client_secret' => env('CVUT_CLIENT_SECRET'),
        'redirect'      => env('CVUT_CALLBACK_URL'),
    ],
];

private function bootCvutSocialiteProvider()
{
    $socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
    $socialite->extend(
        'cvut',
        function ($app) use ($socialite) {
            $config = $app['config']['services.cvut'];
            return $socialite->buildProvider(CvutProvider::class, $config);
        }
    );
}

public function redirectToProvider(): RedirectResponse
{
    return Socialite::with('cvut')->redirect();
}