From c0df57c08771b811cd155c7540572291480a97e7 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Wed, 18 Jan 2017 21:13:05 +0100 Subject: [PATCH] add isRootAdmin() method to User model to get rid of User->root_admin === 1 --- app/Models/User.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index c13a9d133..384e06059 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -146,4 +146,13 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac { $this->notify(new ResetPasswordNotification($token)); } + + /** + * Return true or false depending on wether the user is root admin or not. + * + * @return boolean the user is root admin + */ + public function isRootAdmin() { + return $this->root_admin === 1; + } }