1: <?php
2:
3: namespace LaravelUi5\Core\Controllers;
4:
5: use Illuminate\Routing\Controller;
6: use LaravelUi5\Core\Contracts\Ui5Context;
7: use LaravelUi5\Core\Ui5\Contracts\Ui5AppInterface;
8: use LaravelUi5\Core\Ui5\Ui5Registry;
9: use Symfony\Component\HttpFoundation\Response;
10:
11: class IndexController extends Controller
12: {
13: public function __invoke(Ui5Context $context, Ui5Registry $registry, string $module, string $version): Response
14: {
15: /** @var Ui5AppInterface $app */
16: $app = $context->artifact;
17:
18: $roots = array_merge(
19: [$app->getNamespace() => './'],
20: $registry->resolveRoots($app->getResourceNamespaces())
21: );
22:
23: return response()->view('ui5::index', [
24: 'app' => $app,
25: 'roots' => $roots,
26: ]);
27: }
28: }
29: