Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

qpkq's avatar
Level 1

Laravel Socialite help

Please help.

I created OAuth for social networks through Laravel Socialite. Now I want to make sure that social networks can be linked to the main account in my application for convenient authorization. Tell me how to implement this?

Now done: Routes Controller Service SocialAccount Model

web.php

Route::group(['prefix' => 'v1', 'middleware' => ['session.start']], function () {
    Route::group(['prefix' => 'oauth', 'middleware' => ['throttle.seconds']], function () {
        Route::group(['prefix' => '{provider}', 'middleware' => ['oauth.provider_allowed']], function () {
            Route::get('/', [OAuthController::class, 'redirect']);
            Route::get('/callback', [OAuthController::class, 'handle']);
        });
    });
});

Controller

Service

SocialAccount Model (for future)

0 likes
0 replies

Please or to participate in this conversation.