From 6c065014a68709f19c71994ada318382a15e4d6d Mon Sep 17 00:00:00 2001 From: Calum Towers Date: Sun, 19 Dec 2021 18:42:25 +0000 Subject: [PATCH] fix --- app/Models/Mship/Account.php | 2 +- app/Models/Mship/Concerns/HasRoles.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Models/Mship/Account.php b/app/Models/Mship/Account.php index a3fd2b1802..dbd41514ad 100644 --- a/app/Models/Mship/Account.php +++ b/app/Models/Mship/Account.php @@ -231,7 +231,7 @@ protected static function boot() public static function eventCreated($model, $extra = null, $data = null) { // Add to default role - $defaultRole = Role::where('default', 1)->limit(1)->get(); + $defaultRole = Role::where('default', 1)->limit(1)->first(); $model->assignRole($defaultRole); } diff --git a/app/Models/Mship/Concerns/HasRoles.php b/app/Models/Mship/Concerns/HasRoles.php index ef0fef835f..b71b853b06 100644 --- a/app/Models/Mship/Concerns/HasRoles.php +++ b/app/Models/Mship/Concerns/HasRoles.php @@ -40,8 +40,7 @@ public function fireRoleAssignedEvent($role) return array_walk($role, [$this, 'fireRoleAssignedEvent']); } - // Causing issues... - // event(new RoleAssigned($this, $this->getStoredRole($role))); + event(new RoleAssigned($this, $this->getStoredRole($role))); return true; }