From 22bb08f53df0b7aa1da0904b0c6eb701db135838 Mon Sep 17 00:00:00 2001 From: Natacha Herth Date: Tue, 23 Feb 2021 17:22:28 +0100 Subject: [PATCH] Role is protected --- src/Models/Role.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Models/Role.php b/src/Models/Role.php index 1f074e9..de13045 100644 --- a/src/Models/Role.php +++ b/src/Models/Role.php @@ -20,4 +20,13 @@ class Role extends Model 'guard','name' ]; + /** + * Check if the role is protected + * @return boolean + */ + public function getIsProtectedAttribute() + { + return in_array($this->guard, config('access-control.protected')); + } + }