Skip to content

Commit 7a45b1b

Browse files
committed
Fix provider data and add short hand for casting
1 parent 1347b81 commit 7a45b1b

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/Model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ private function cast(string $type, $value)
8181
}
8282

8383
switch ($type) {
84+
case 'int':
8485
case 'integer':
8586
return is_integer($value) ? $value : intval($value);
8687

88+
case 'bool':
8789
case 'boolean':
8890
return is_bool($value) ? $value : boolval($value);
8991

src/Model/Base/User.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class User extends Model
3030

3131
protected array $casts = [
3232
'is_admin' => 'boolean',
33-
'per_page' => 'integer'
33+
'per_page' => 'integer',
34+
'provider_data' => 'array'
3435
];
3536

3637
public function getEmail(): ?string

0 commit comments

Comments
 (0)