1: <?php
2:
3: namespace LaravelUi5\Core;
4:
5: use Illuminate\Support\Facades\File;
6: use LaravelUi5\Core\Attributes\HideIntent;
7: use LaravelUi5\Core\Enums\ArtifactType;
8: use LaravelUi5\Core\Ui5\AbstractUi5App;
9: use LaravelUi5\Core\Ui5\Capabilities\LaravelUi5ManifestInterface;
10:
11: #[HideIntent]
12: class DashboardApp extends AbstractUi5App
13: {
14: public function getType(): ArtifactType
15: {
16: return ArtifactType::Application;
17: }
18:
19: public function getNamespace(): string
20: {
21: return 'com.laravelui5.dashboard';
22: }
23:
24: public function getVersion(): string
25: {
26: return '1.0.0';
27: }
28:
29: public function getTitle(): string
30: {
31: return 'Dashboard';
32: }
33:
34: public function getDescription(): string
35: {
36: return 'Generic Ui5 Dashboard Application';
37: }
38:
39: public function getUi5BootstrapAttributes(): array
40: {
41: return array(
42: 'theme' => 'sap_horizon',
43: 'oninit' => 'module:com/laravelui5/dashboard/Component',
44: 'async' => 'true',
45: 'compatversion' => 'edge',
46: 'frameoptions' => 'trusted',
47: 'xx-waitfortheme' => 'true',
48: 'xx-supportedlanguages' => 'en,de',
49: );
50: }
51:
52: public function getResourceNamespaces(): array
53: {
54: return array();
55: }
56:
57: public function getAdditionalHeadScript(): ?string
58: {
59: return <<<JS
60: sap.ui.getCore().attachInit(function () {
61: sap.ui.core.Component.create({
62: name: "com.laravelui5.dashboard",
63: manifest: true,
64: async: true
65: }).then(function (oComponent) {
66: new sap.ui.core.ComponentContainer({
67: component: oComponent,
68: height: "100%"
69: }).placeAt("content");
70: }).catch(function (err) {
71: console.error("Component load failed:", err);
72: });
73: });
74: JS;
75: }
76:
77: public function getAdditionalInlineCss(): ?string
78: {
79: return <<<CSS
80:
81: CSS;
82: }
83:
84: public function getAssetPath(string $filename): ?string
85: {
86: $path = __DIR__ . '/../resources/dashboard-app/' . ltrim($filename, '/');
87: return File::exists($path) ? $path : null;
88: }
89:
90: public function getVendor(): string
91: {
92: return 'Pragmatiqu IT GmbH';
93: }
94:
95: public function getManifestPath(): string
96: {
97: return __DIR__ . '/../resources/dashboard-app/manifest.json';
98: }
99:
100: public function getLaravelUiManifest(): LaravelUi5ManifestInterface
101: {
102: return app(CoreManifest::class);
103: }
104: }
105: