Skip to content

Commit e956959

Browse files
committed
Fix ownership verification - Closes #305, closes #320
1 parent 480268a commit e956959

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

app/Models/Group.php

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class Group extends Model
5252
*/
5353
protected $casts = [
5454
'twofaccounts_count' => 'integer',
55+
'user_id' => 'integer',
5556
];
5657

5758
/**

app/Models/TwoFAccount.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ class TwoFAccount extends Model implements Sortable
145145
*
146146
* @var array<string, string>
147147
*/
148-
protected $casts = [];
148+
protected $casts = [
149+
'user_id' => 'integer',
150+
];
149151

150152
/**
151153
* The event map for the model.

tests/Unit/GroupModelTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public function test_model_configuration()
2727
['created_at', 'updated_at'],
2828
['*'],
2929
[],
30-
['id' => 'int', 'twofaccounts_count' => 'integer'],
30+
[
31+
'id' => 'int',
32+
'twofaccounts_count' => 'integer',
33+
'user_id' => 'integer'
34+
],
3135
[
3236
'deleting' => GroupDeleting::class,
3337
'deleted' => GroupDeleted::class,

tests/Unit/TwoFAccountModelTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ public function test_model_configuration()
3333
[],
3434
['*'],
3535
[],
36-
['id' => 'int'],
36+
[
37+
'id' => 'int',
38+
'user_id' => 'integer'
39+
],
3740
['deleted' => TwoFAccountDeleted::class],
3841
['created_at', 'updated_at'],
3942
\Illuminate\Database\Eloquent\Collection::class,

0 commit comments

Comments
 (0)