Loheide-eu-mitarbeiterplatt.../sdk/stubs/Plugin.php.stub
Friederich Loheide ea2200cb3e
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m49s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m51s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m12s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m33s
Plugin-SDK: Oberflächen für Kunden-Plugins, Generator, Doku (0.20.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 04:57:28 +00:00

30 lines
1.1 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace {{namespace}};
use App\Dashboard\Widgets;
use App\Models\User;
use App\Plugins\Plugin;
use App\Support\Navigation;
/**
* {{name}}
*
* register(): Menüpunkte, Kacheln, Rechte, Blöcke anmelden (läuft bei jedem Aufruf).
* boot(): nach dem Laden aller Plugins – z. B. Hooks, geplante Aufgaben.
* Routen (routes/web.php) und Migrationen (database/migrations) lädt das Portal selbst.
* Mehr dazu: docs/PLUGINS.md im Portal.
*/
class {{studly}}Plugin extends Plugin
{
public function register(): void
{
// Menüpunkt im Portal („Mehr“ bzw. unter „Menü“ im Backend frei anordenbar)
$this->app->make(Navigation::class)->add('{{slug}}', '{{name}}', '/{{slug}}', active: '{{slug}}.*', sort: 80);
// Kachel auf der Startseite – Vue-Komponente resources/js/widgets/Hello.vue
$this->app->make(Widgets::class)->add('{{slug}}.hello', '{{slug}}::Hello', 'aside', sort: 90,
props: fn (User $user) => ['name' => $user->first_name ?: $user->name],
label: '{{name}}: Hallo-Kachel');
}
}