Files
investbrain/app/Models/ConnectedAccount.php
T
2025-01-28 17:33:54 -06:00

58 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasTimestamps;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ConnectedAccount extends Model
{
use HasFactory;
use HasTimestamps;
use HasUuids;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'provider',
'provider_id',
'token',
'secret',
'refresh_token',
'expires_at',
];
protected $with = [
'user',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'created_at' => 'datetime',
'expires_at' => 'datetime',
];
}
/**
* Get user of the connected account.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}