Download the PHP package ithilbert/module without Composer
On this page you can find all versions of the php package ithilbert/module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ithilbert/module
More information about ithilbert/module
Files in ithilbert/module
Package module
Short Description Zum erstellen und verwalten von Modulen
License MIT
Homepage https://www.it-hilbert.com
Informations about the package module
IT-Hilbert Module für Laravel
Dieses Paket dient zum Erstellen und Verwalten von Modulen in einer Laravel-Applikation. Es erzeugt Modul-Strukturen nach dem Clean-Architecture-Prinzip (Domain / Application / Infrastructure).
Installation
-
Installiere das Paket über Composer:
-
Registriere den ServiceProvider in
config/app.php(falls Autodiscovery nicht genutzt wird): - Veröffentliche die Konfiguration:
Modul-Speicherort
Module werden unter /module/{name}/ (Projektroot, kleingeschrieben) abgelegt — nicht unter app/Modules/.
In der composer.json des Projekts muss der PSR-4-Eintrag ergänzt werden:
Erzeugte Verzeichnisstruktur
Namespace-Konvention
Artisan Befehle
Modul-Verwaltung
php artisan module:create {Name}: Erstellt eine neue Modul-Struktur unter/module/{name}/inklusive aller Clean-Architecture-Schichten.php artisan module:set {Name}: Setzt das Modul, mit dem aktuell gearbeitet wird.php artisan module:get: Zeigt den Namen des aktuell gesetzten Moduls an.
Generatoren (beziehen sich auf das aktive Modul)
php artisan module:model {Name}: Erstellt ein Model im aktiven Modul (Domain/Models/).php artisan module:controller {Name}: Erstellt einen dünnen Controller im aktiven Modul.php artisan module:migration {Name}: Erstellt eine Migration für das aktive Modul.php artisan module:view {Name}: Erstellt eine Blade-View im Modul.php artisan module:config {Name}: Erstellt eine Konfigurationsdatei für das Modul.
Konfiguration
In der config/module.php können Standard-CSS-Klassen für generierte Formulare und Komponenten festgelegt werden:
row_classes: Klassen für Reihen.col_label_classes: Klassen für Label-Spalten.col_input_classes: Klassen für Input-Spalten.
Architektur-Regeln (bindend)
- Controller dünn: max. 5–10 Zeilen pro Methode, delegiert immer an einen UseCase.
- UseCases:
final-Klasse, eineexecute()-Methode = ein Anwendungsfall. - Models:
final,$fillable(kein$guarded),SoftDeletes, kein Geschäftslogik. - Enums statt magischer Strings für fachliche Zustände.
- Form Requests für alle Validierungen — kein
$request->all(). - Ports + Adapters für externe Dienste (Mail, Payment, Storage etc.).