📄️ Blade Directives
Laravext offers some blade directives to be used in your project.
📄️ Routing
In order to declare routes in a project with Laravext, you'll have to use some of the methods provided by it.
📄️ Nexus Response
Similar to Inertia.js' Responses, the nexus response is a way render a view containing a @nexus blade directive (or @startNexus/@endNexus). Here's an example of how to use it (for the sake of simplicity, I won't use a controller):
📄️ Shared Props
Shared props are props that you might want to pass to every page in your application. They can be used to pass data that is common to all pages, such as the current user, the application's name, etc. This is done in a similar way to Inertia.js' shared data. In order to use shared props, for every route, you must create a middleware, such as the example below:
📄️ Head Component
Much like the Head Component from Inertia.js, Laravext has its own Head component that allows you to set the title of the page.
📄️ Link Component
Much like the Link Component from Inertia.js, Laravext has its own Link component, which is a wrapper around the a tag and the visit function that allows you to navigate between pages without a full page reload. It accepts two props: preserveScroll (defaults to false) and a redirectToUrlIntended (defaults to true).
📄️ The visit function
Much like Inertia.js' Protocol, you can use the visit(url, options = { ... }) function to navigate to a new page that uses Laravext. This creates a smooth SPA experience, as it doesn't reload the page. If the version of the application changes between visits, or if the view set for that route is different from the one that was previously loaded, an usual page visit will happen.
📄️ Chrome Extension
Similar to the Inertia.js devtools, there's also a Chrome extension that can be used to debug the data that is being passed to the client.