Skip to content

Commit c0df57c

Browse files
committed
add isRootAdmin() method to User model to get rid of User->root_admin === 1
1 parent d3d1b88 commit c0df57c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/Models/User.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,13 @@ public function sendPasswordResetNotification($token)
146146
{
147147
$this->notify(new ResetPasswordNotification($token));
148148
}
149+
150+
/**
151+
* Return true or false depending on wether the user is root admin or not.
152+
*
153+
* @return boolean the user is root admin
154+
*/
155+
public function isRootAdmin() {
156+
return $this->root_admin === 1;
157+
}
149158
}

0 commit comments

Comments
 (0)