@@ -48,7 +48,7 @@ public function users(): BelongsToMany
48
48
*/
49
49
public function abilities (): HasMany
50
50
{
51
- return $ this ->hasMany (Teams::model ('ability ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ),'id ' );
51
+ return $ this ->hasMany (Teams::model ('ability ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ), 'id ' );
52
52
}
53
53
54
54
/**
@@ -58,7 +58,7 @@ public function abilities(): HasMany
58
58
*/
59
59
public function roles (): HasMany
60
60
{
61
- return $ this ->hasMany (Teams::model ('role ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ),'id ' );
61
+ return $ this ->hasMany (Teams::model ('role ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ), 'id ' );
62
62
}
63
63
64
64
/**
@@ -68,7 +68,7 @@ public function roles(): HasMany
68
68
*/
69
69
public function groups (): HasMany
70
70
{
71
- return $ this ->hasMany (Teams::model ('group ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ),'id ' );
71
+ return $ this ->hasMany (Teams::model ('group ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ), 'id ' );
72
72
}
73
73
74
74
/**
@@ -78,7 +78,7 @@ public function groups(): HasMany
78
78
*/
79
79
public function invitations (): HasMany
80
80
{
81
- return $ this ->hasMany (Teams::model ('invitation ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ),'id ' );
81
+ return $ this ->hasMany (Teams::model ('invitation ' ), Config::get ('teams.foreign_keys.team_id ' , 'team_id ' ), 'id ' );
82
82
}
83
83
84
84
/**
@@ -198,7 +198,7 @@ public function deleteUser(object $user): void
198
198
*/
199
199
public function hasUserWithEmail (string $ email ): bool
200
200
{
201
- return $ this ->allUsers ()->contains (fn ($ user ) => $ user ->email === $ email );
201
+ return $ this ->allUsers ()->contains (fn ($ user ) => $ user ->email === $ email );
202
202
}
203
203
204
204
/**
@@ -209,7 +209,7 @@ public function hasUserWithEmail(string $email): bool
209
209
*/
210
210
public function userRole (object $ user ): object |null
211
211
{
212
- return $ this ->owner === $ user ? new Owner : $ this ->getRole ($ this ->users ->firstWhere ('id ' , $ user ->id )->membership ->role ->id ?? null );
212
+ return $ this ->owner === $ user ? new Owner () : $ this ->getRole ($ this ->users ->firstWhere ('id ' , $ user ->id )->membership ->role ->id ?? null );
213
213
}
214
214
215
215
/**
@@ -447,7 +447,7 @@ public function getPermissionIds(array $codes): array
447
447
448
448
if (!empty ($ newPermissions )) {
449
449
450
- $ items = array_map (fn ($ code ) => [$ teamIdField => $ this ->id ,'code ' => $ code ], $ newPermissions );
450
+ $ items = array_map (fn ($ code ) => [$ teamIdField => $ this ->id ,'code ' => $ code ], $ newPermissions );
451
451
452
452
Teams::model ('permission ' )::query ()->insert ($ items );
453
453
0 commit comments