@extends('layouts.admin') @section('title', 'Modules Management') @section('header_title', 'Modules Management') @section('content')

Installed Modules

Install New Module
@if (session('success')) @endif @if (session('error')) @endif
{{-- Check if $modules is a collection and then if it's empty, or if it's an array and empty --}} @if ((is_object($modules) && method_exists($modules, 'isEmpty') && $modules->isEmpty()) || (is_array($modules) && empty($modules)))

No modules are currently installed.

You can create a new module using the Artisan command: php artisan module:make YourModuleName

@else
@foreach ($modules as $module) @endforeach
Icon Name Status Description Actions
{{-- You can fetch an icon from module.json or use a default --}} @php $iconPath = $module->get('admin_menu.icon_path') ?? null; $iconClass = $module->get('admin_menu.icon_class') ?? 'M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z'; // Default icon path @endphp @if($iconPath && file_exists(public_path($iconPath))) {{ $module->getName() }} icon @else @endif {{ $module->getName() }} @if ($module->isEnabled()) Enabled @else Disabled @endif {{ $module->get('description', 'N/A') }}
@if ($module->isEnabled())
@csrf
@else
@csrf
@endif {{-- Prevent uninstalling core or essential modules if needed --}} {{-- Adjust 'core', 'system' to your actual protected module names (lowercase) --}} @if (!in_array($module->getLowerName(), ['core', 'system', 'yourcoremodulename']))
@csrf @method('DELETE')
@else Protected @endif
@endif
@endsection