| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Controllers; |
| 4: | |
| 5: | use Illuminate\Http\Response; |
| 6: | use Illuminate\Support\Facades\View; |
| 7: | use LaravelUi5\Core\Contracts\Ui5Context; |
| 8: | use LaravelUi5\Core\Ui5\Contracts\Ui5DashboardInterface; |
| 9: | |
| 10: | class DashboardController |
| 11: | { |
| 12: | public function __invoke(Ui5Context $context, string $slug): Response |
| 13: | { |
| 14: | |
| 15: | $dashboard = $context->artifact; |
| 16: | |
| 17: | $xml = View::file($dashboard->getDashboard())->render(); |
| 18: | |
| 19: | return response($xml, 200, [ |
| 20: | 'Content-Type' => 'application/xml', |
| 21: | ]); |
| 22: | } |
| 23: | } |
| 24: | |