This commit is contained in:
Bozhidar 2024-04-26 22:45:08 +03:00
parent 3ba3f1e904
commit c9ee8064b0
2 changed files with 10 additions and 2 deletions

View file

@ -89,6 +89,14 @@ class Modules extends Page
}
}
public function openUnistallModal($module)
{
$findModule = Module::where('name', $module)->first();
if ($findModule) {
$findModule->delete();
}
}
public function openInstallModal($module)
{
$this->installModule = $module;

View file

@ -71,7 +71,7 @@
</x-slot>
<x-filament::dropdown.list>
<x-filament::dropdown.list.item wire:click="openInstallModal('{{$module['name']}}')">
<x-filament::dropdown.list.item wire:key="btn-install-modal-{{md5($module['name'])}}" wire:click="openInstallModal('{{$module['name']}}')">
<div class="flex gap-2 items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24">
<path fill="currentColor" d="M11 2v5H8l4 4l4-4h-3V2h7a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm8 14H5v4h14zm-2 1v2h-2v-2z"></path>
@ -84,7 +84,7 @@
</div>
</x-filament::dropdown.list.item>
@if ($module['installed'])
<x-filament::dropdown.list.item wire:click="openUnistallModal('{{$module['name']}}')">
<x-filament::dropdown.list.item wire:key="btn-unistall-modal-{{md5($module['name'])}}" wire:click="openUnistallModal('{{$module['name']}}')">
<div class="flex gap-2 items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24">
<path fill="currentColor" d="M7.615 20q-.69 0-1.152-.462T6 18.385V6H5V5h4v-.77h6V5h4v1h-1v12.385q0 .69-.462 1.152T16.385 20zm2.193-3h1V8h-1zm3.384 0h1V8h-1z"></path>