- Plugins nach WordPress-Prinzip: plugin.json-Manifest mit Versions- und Abhängigkeitsprüfung, eigenes PSR-4-Autoloading, register()/boot(), activate()/deactivate()/uninstall(), Migrationen, Routen und Views je Plugin - plugins-core/ (mitgeliefert, aktiv bis zur Deaktivierung) und plugins/ (Kunden-Plugins, geschützt vor Updates, inaktiv bis zur Aktivierung) - Zustand in storage/app/plugins.json – Laden ohne Datenbankabfrage - Wiederherstellungsmodus: Ausnahmen und Fatal Errors beim Laden deaktivieren das Plugin, das Portal bleibt erreichbar - Hooks (Actions/Filter mit Prioritäten) und Registries für Navigation, Startseiten-Kacheln, Rechte und Admin-Seiten (Filament-Discovery) - Admin-Seite „Plugins“: aktivieren, deaktivieren, per ZIP installieren (ZIP-Slip-Schutz), löschen mit oder ohne Daten; abschaltbar per INHAUS_DISALLOW_FILE_MODS - Startseite komplett aus Kacheln; Plugin-Seiten als „slug::Seite“ - Version 0.3.0 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import '../css/app.css';
|
||
import 'vue-sonner/style.css';
|
||
|
||
import { createApp, h } from 'vue';
|
||
import { createInertiaApp } from '@inertiajs/vue3';
|
||
|
||
createInertiaApp({
|
||
title: (title, page) => {
|
||
const portalName = page.props.branding.portal_name;
|
||
|
||
return title ? `${title} – ${portalName}` : portalName;
|
||
},
|
||
resolve: (name) => {
|
||
// „news::Index“ → Seite aus einem mitgelieferten Plugin (plugins-core/news/resources/js/pages/Index.vue)
|
||
const pages = {
|
||
...import.meta.glob('./pages/**/*.vue'),
|
||
...import.meta.glob('../../plugins-core/*/resources/js/pages/**/*.vue'),
|
||
};
|
||
const [plugin, pageName] = name.includes('::') ? name.split('::') : [null, name];
|
||
const page = plugin ? pages[`../../plugins-core/${plugin}/resources/js/pages/${pageName}.vue`] : pages[`./pages/${name}.vue`];
|
||
|
||
if (!page) {
|
||
throw new Error(`Seite nicht gefunden: ${name}`);
|
||
}
|
||
|
||
return page();
|
||
},
|
||
setup({ el, App, props, plugin }) {
|
||
createApp({ render: () => h(App, props) })
|
||
.use(plugin)
|
||
.mount(el);
|
||
},
|
||
progress: {
|
||
color: 'var(--brand)',
|
||
},
|
||
});
|