@@ -148,26 +148,20 @@ protected function redirectUris(): Attribute
148
148
}
149
149
150
150
/**
151
- * Get the client's grant types.
151
+ * Interact with the client's grant types.
152
152
*/
153
153
protected function grantTypes (): Attribute
154
154
{
155
155
return Attribute::make (
156
- get: function (?string $ value , array $ attributes ) {
157
- if (isset ($ value )) {
158
- return $ this ->fromJson ($ value );
159
- }
160
-
161
- return array_keys (array_filter ([
162
- 'authorization_code ' => ! empty ($ this ->redirect_uris ),
163
- 'client_credentials ' => $ this ->confidential () && $ this ->firstParty (),
164
- 'implicit ' => ! empty ($ this ->redirect_uris ),
165
- 'password ' => $ this ->password_client ,
166
- 'personal_access ' => $ this ->personal_access_client ,
167
- 'refresh_token ' => true ,
168
- 'urn:ietf:params:oauth:grant-type:device_code ' => true ,
169
- ]));
170
- },
156
+ get: fn (?string $ value ): array => isset ($ value ) ? $ this ->fromJson ($ value ) : array_keys (array_filter ([
157
+ 'authorization_code ' => ! empty ($ this ->redirect_uris ),
158
+ 'client_credentials ' => $ this ->confidential () && $ this ->firstParty (),
159
+ 'implicit ' => ! empty ($ this ->redirect_uris ),
160
+ 'password ' => $ this ->password_client ,
161
+ 'personal_access ' => $ this ->personal_access_client && $ this ->confidential (),
162
+ 'refresh_token ' => true ,
163
+ 'urn:ietf:params:oauth:grant-type:device_code ' => true ,
164
+ ])),
171
165
);
172
166
}
173
167
0 commit comments