From 8ad3fd087fc5d656a953ace8f3342a4bd4600f93 Mon Sep 17 00:00:00 2001 From: FoskyM Date: Sun, 1 Oct 2023 17:16:45 +0800 Subject: [PATCH] fix(model): add guarded --- src/Models/AccessToken.php | 1 + src/Models/AuthorizationCode.php | 1 + src/Models/Client.php | 1 - src/Models/Jwt.php | 1 + src/Models/RefreshToken.php | 1 + src/Models/Scope.php | 2 +- 6 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Models/AccessToken.php b/src/Models/AccessToken.php index 502d559..4204e88 100644 --- a/src/Models/AccessToken.php +++ b/src/Models/AccessToken.php @@ -15,4 +15,5 @@ use Flarum\Database\AbstractModel; class AccessToken extends AbstractModel { protected $table = 'oauth_access_tokens'; + protected $guarded = []; } diff --git a/src/Models/AuthorizationCode.php b/src/Models/AuthorizationCode.php index 8b34f73..f144175 100644 --- a/src/Models/AuthorizationCode.php +++ b/src/Models/AuthorizationCode.php @@ -15,4 +15,5 @@ use Flarum\Database\AbstractModel; class AuthorizationCode extends AbstractModel { protected $table = 'oauth_authorization_codes'; + protected $guarded = []; } diff --git a/src/Models/Client.php b/src/Models/Client.php index c9e2c98..d6dc3d2 100644 --- a/src/Models/Client.php +++ b/src/Models/Client.php @@ -15,7 +15,6 @@ use Flarum\Database\AbstractModel; class Client extends AbstractModel { protected $table = 'oauth_clients'; - protected $guarded = []; public static function build(string $client_id, string $client_secret, int $user_id) diff --git a/src/Models/Jwt.php b/src/Models/Jwt.php index d9ee703..652a3c4 100644 --- a/src/Models/Jwt.php +++ b/src/Models/Jwt.php @@ -15,4 +15,5 @@ use Flarum\Database\AbstractModel; class Jwt extends AbstractModel { protected $table = 'oauth_jwt'; + protected $guarded = []; } diff --git a/src/Models/RefreshToken.php b/src/Models/RefreshToken.php index 7f6bea0..92919f4 100644 --- a/src/Models/RefreshToken.php +++ b/src/Models/RefreshToken.php @@ -15,4 +15,5 @@ use Flarum\Database\AbstractModel; class RefreshToken extends AbstractModel { protected $table = 'oauth_refresh_tokens'; + protected $guarded = []; } diff --git a/src/Models/Scope.php b/src/Models/Scope.php index 125bf94..b191afc 100644 --- a/src/Models/Scope.php +++ b/src/Models/Scope.php @@ -15,7 +15,7 @@ use Flarum\Database\AbstractModel; class Scope extends AbstractModel { protected $table = 'oauth_scopes'; - + protected $guarded = []; static public function get_path_scope($path = '') { return self::where('resource_path', 'like', $path . '%')->first();