2024-03-17 02:39:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2025-10-12 03:48:04 +07:00
|
|
|
use App\Models\Traits\NexusActivityLogTrait;
|
2024-03-18 02:57:55 +08:00
|
|
|
use Illuminate\Support\Str;
|
2024-03-17 02:39:26 +08:00
|
|
|
use Laravel\Passport\Client;
|
|
|
|
|
|
|
|
|
|
class OauthClient extends Client
|
|
|
|
|
{
|
2025-10-12 03:48:04 +07:00
|
|
|
use NexusActivityLogTrait;
|
|
|
|
|
|
2024-03-18 02:57:55 +08:00
|
|
|
protected static function booted(): void
|
|
|
|
|
{
|
|
|
|
|
static::creating(function (OauthClient $model) {
|
|
|
|
|
$model->secret = Str::random(40);
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-03-17 02:39:26 +08:00
|
|
|
public function skipsAuthorization(): bool
|
|
|
|
|
{
|
|
|
|
|
return (bool)$this->skips_authorization;
|
|
|
|
|
}
|
|
|
|
|
}
|