mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Database\Factories\OAuthConnectionFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* 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
|
|
{
|
|
/** @use HasFactory<OAuthConnectionFactory> */
|
|
use HasFactory;
|
|
|
|
protected $table = 'oauth_connections';
|
|
|
|
/**
|
|
* The relationship between the OAuth connection and the user.
|
|
*
|
|
* @return BelongsTo<User, $this>
|
|
*/
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
}
|
|
}
|