chore: init saasshop repo + sql migrations runner + gitee go
This commit is contained in:
30
app/Models/OauthAccount.php
Normal file
30
app/Models/OauthAccount.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class OauthAccount extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id', 'merchant_id', 'platform', 'provider', 'openid', 'unionid', 'app_id', 'nickname', 'avatar', 'raw_payload',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'raw_payload' => 'array',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function merchant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Merchant::class, 'merchant_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user