osb/app/Models/UserOauth.php
Deon George 09f2eb8d9d
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 33s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
Remove binary attributes from DB, should be json columns
2024-07-07 21:22:14 +10:00

32 lines
534 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Casts\CollectionOrNull;
use App\Traits\SiteID;
class UserOauth extends Model
{
use SiteID;
protected $table = 'user_oauth';
protected $casts = [
'oauth_data' => CollectionOrNull::class,
];
public function User()
{
return $this->belongsTo(User::class);
}
/**
* Get a link token to use when validating account.
*/
public function getLinkTokenAttribute(): string
{
return strtoupper(substr(md5($this->id.$this->date_last),0,8));
}
}