Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
update menu permission if updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dietercoopman committed Jun 24, 2021
1 parent c0cff4e commit 91c05be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Http/Livewire/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public function delete()
public function updatePermission()
{
$this->validate();
if($this->permission->isDirty()){
$original = $this->permission->getOriginal('name');
//update menu with this permission to new permission
$menu = \LLoadoutInforce\Models\Menu::wherePermission($original)->update(['permission' => $this->permission->name]);
}

$this->permission->save();
$this->emit('saved');

Expand Down

0 comments on commit 91c05be

Please sign in to comment.