Skip to content

Commit

Permalink
chore: Refactor RoleHelper.php to use a variable from the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
zerossB committed May 24, 2024
1 parent 9e83522 commit 5275d28
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ trait RoleHelper
{
private function roleCreateOrUpdate(stdClass $message): void
{
$roleModel = app(config('permission.models.role'));
$roleModelFromConfig = app(config('permission.models.role'));

$roleModel = $roleModel::where('uuid', $message->uuid)
$roleModel = $roleModelFromConfig::where('uuid', $message->uuid)
->first();

if (! $roleModel) {
$roleModel = new $roleModel();
$roleModel = new $roleModelFromConfig();
}

$roleModel->uuid = $message->uuid;
Expand Down

0 comments on commit 5275d28

Please sign in to comment.