File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,22 @@ protected function setupDefaultDirectives()
261261 return "<?php echo ViewsPath( $ expression); ?> " ;
262262 });
263263
264+ $ this ->compiler ()->directive ('route ' , function ($ expression ) {
265+ return "<?php echo app()->route( $ expression)['path'] ?? ''; ?> " ;
266+ });
267+
268+ $ this ->compiler ()->directive ('viteReactRefresh ' , function ($ expression ) {
269+ return "<?php echo \Leaf\Vite::reactRefresh(); ?> " ;
270+ });
271+
272+ $ this ->compiler ()->directive ('inertiaHead ' , function ($ expression ) {
273+ return '<?php if (!isset($__inertiaSsrDispatched)) { $__inertiaSsrDispatched = true; $__inertiaSsrResponse = (new \Leaf\Inertia\Ssr\Gateway())->dispatch($page); } if ($__inertiaSsrResponse) { echo $__inertiaSsrResponse->head; } ?> ' ;
274+ });
275+
276+ $ this ->compiler ()->directive ('inertia ' , function ($ expression ) {
277+ return '<?php if (!isset($__inertiaSsrDispatched)) { $__inertiaSsrDispatched = true; $__inertiaSsrResponse = (new \Leaf\Inertia\Ssr\Gateway())->dispatch($page); } if ($__inertiaSsrResponse) { echo $__inertiaSsrResponse->body; } else { ?><div id="app" data-page="<?php echo e(json_encode($page)); ?>"></div><?php } ?> ' ;
278+ });
279+
264280 $ this ->directive ('toastContainer ' , function ($ expression ) {
265281 return <<<HTML
266282 <div class="relative w-auto h-auto" x-data>
You can’t perform that action at this time.
0 commit comments