2024-03-06 16:30:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Support\Facades\Crypt;
|
|
|
|
|
|
|
|
class OauthSetting extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
protected function clientSecret(): Attribute
|
|
|
|
{
|
|
|
|
return Attribute::make(
|
2024-06-10 20:43:34 +00:00
|
|
|
get: fn (?string $value) => empty($value) ? null : Crypt::decryptString($value),
|
|
|
|
set: fn (?string $value) => empty($value) ? null : Crypt::encryptString($value),
|
2024-03-06 16:30:19 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|