We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9eaa21 commit e3b0465Copy full SHA for e3b0465
src/Response.php
@@ -270,6 +270,21 @@ public function render(string $view, array $data = [])
270
$this->view($view, $data);
271
}
272
273
+ /**
274
+ * Render an inertia view file if inertia is installed
275
+ *
276
+ * @param string $view The view file to render
277
+ * @param array $data The data to pass to the view
278
+ */
279
+ public function inertia(string $view, array $data = [])
280
+ {
281
+ if (function_exists('inertia')) {
282
+ return inertia($view, $data);
283
+ }
284
+
285
+ trigger_error('Inertia not found. Run `leaf install inertia` or `composer require leafs/inertia`');
286
287
288
/**
289
* Output some data and break the application
290
*
0 commit comments