Code cleanup

This commit is contained in:
James Cole
2023-11-04 14:18:49 +01:00
parent 5a35960434
commit ba0843d0bb
211 changed files with 566 additions and 568 deletions

View File

@@ -102,14 +102,14 @@ class UserGroup extends Model
* @return UserGroup
* @throws NotFoundHttpException
*/
public static function routeBinder(string $value): UserGroup
public static function routeBinder(string $value): self
{
if (auth()->check()) {
$userGroupId = (int)$value;
/** @var User $user */
$user = auth()->user();
/** @var UserGroup|null $userGroup */
$userGroup = UserGroup::find($userGroupId);
$userGroup = self::find($userGroupId);
if (null === $userGroup) {
throw new NotFoundHttpException();
}