63
loading...
This website collects cookies to deliver better user experience
resources
folder into a Vue app generated by Vue CLI. This means that inside resources
you can do things like vue add some-vue-cli-plugin
which you can't when using Laravel Mix. Vue CLI is also much more stable than Laravel Mix and much more focused and battle tested for use with Vue, so you are probably going to save some time avoiding common issues related to Laravel Mix.resources
, if that's your thing...tw-
.v-link
component which is a Vuetify v-btn
component wrapped by an Inertia.js Link
component. This way you can use Inertia.js links everywhere without having to remember to include the Link
component locally on every component and they can use every style available to v-btn
components. Inertia's Link
component is also registered globally.<v-link :href="someUrl"
color="success"
rounded
outlined
x-large
>
This is an Inertia.js link
</v-link>
// Success message
return redirect()
->route('dashboard')
->toast('Laravel Viltify is awesome');
// Error message
return redirect()
->route('dashboard')
->toast('You didn\'t give Laravel Viltify a star. =(', 'error');
pages
prop at resources/vue.config.js
.pages: {
...page('main', 'app'),
...page('admin', 'app-admin')
},
// The following disables prefetch links generation for each endpoint
chainWebpack: config => {
config.plugins.delete('prefetch-main'),
config.plugins.delete('prefetch-admin')
}
app-admin.blade.php
view when rendering an admin page.return Inertia::setRootView('app-admin')
->render('admin/Dashboard');
MIX_
prefixed variables inside .env
file. Here, since our resources
folder is actually a Vue CLI generated app, you can leverage the pattern shipped by Vue CLI do deal with environment variables. Laravel Viltify comes out of the box with a resources/.env.local
for the devserver and a resources/.env.production
example file, so you can deal with every client side setting separated from Laravel settings.