This commit is contained in:
Adrian Hopek
2022-01-13 09:08:36 +01:00
parent 197e7da9cc
commit 38af769f7b
17 changed files with 1434 additions and 144 deletions

View File

@@ -7,14 +7,11 @@ namespace Toby\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Socialite\Two\User as SocialUser;
/**
* @property int $id
* @property string $name
* @property string $email
* @property string $avatar
* @property string $google_id
*/
class User extends Authenticatable
{
@@ -29,17 +26,4 @@ class User extends Authenticatable
protected $hidden = [
"remember_token",
];
protected $casts = [
"email_verified_at" => "datetime",
];
public function syncGoogleData(SocialUser $user): void
{
$this->name = $user->getName();
$this->avatar = $user->getAvatar();
$this->google_id = $user->getId();
$this->save();
}
}