Skip to content

Commit

Permalink
Update CreateConnectedAccount.php
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbutcher authored Jan 10, 2021
1 parent 4888460 commit b6a6702
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stubs/app/Actions/Socialstream/CreateConnectedAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Actions\Socialstream;

use App\Models\ConnectedAccount;
use App\Models\User;
use JoelButcher\Socialstream\Contracts\CreatesConnectedAccounts;
use Laravel\Socialite\Contracts\User as ProviderUser;
Expand Down Expand Up @@ -37,7 +38,8 @@ public function create(User $user, string $provider, ProviderUser $providerUser)
return $connectedAccount;
}

return $user->connectedAccounts()->forceCreate([
return ConnectedAccount::forceCreate([
'user_id' => $user->id,
'provider' => strtolower($provider),
'provider_id' => $providerUser->getId(),
'name' => $providerUser->getName(),
Expand Down

0 comments on commit b6a6702

Please sign in to comment.