Files
nexusphp/app/Models/OauthClient.php
2024-03-18 02:57:55 +08:00

21 lines
405 B
PHP

<?php
namespace App\Models;
use Illuminate\Support\Str;
use Laravel\Passport\Client;
class OauthClient extends Client
{
protected static function booted(): void
{
static::creating(function (OauthClient $model) {
$model->secret = Str::random(40);
});
}
public function skipsAuthorization(): bool
{
return (bool)$this->skips_authorization;
}
}