forge/app/Models/OAuthConnection.php

58 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
2025-01-30 00:23:55 -05:00
declare(strict_types=1);
namespace App\Models;
2025-01-30 15:44:05 -05:00
use Carbon\Carbon;
2025-01-30 20:49:56 -05:00
use Database\Factories\OAuthConnectionFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
2025-01-30 15:44:05 -05:00
/**
* OAuthConnection Model
*
* @property int $id
* @property int $user_id
* @property string $provider
* @property string $provider_id
* @property string $token
* @property string $refresh_token
* @property string $nickname
* @property string $name
* @property string $email
* @property string $avatar
* @property Carbon $created_at
* @property Carbon $updated_at
* @property-read User $user
*/
class OAuthConnection extends Model
{
2025-01-30 20:49:56 -05:00
/** @use HasFactory<OAuthConnectionFactory> */
use HasFactory;
protected $table = 'oauth_connections';
2025-01-30 15:44:05 -05:00
/**
* The relationship between the OAuth connection and the user.
*
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
2024-10-12 13:18:04 -06:00
/**
* The attributes that should be cast to native types.
*/
protected function casts(): array
{
return [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
}
}