adelin's avatar

vue-router/laravel routes + vue-components/laravel's blade

Hello there!

I have an app that i need to make but the problem is that in time it could become quite big. So now, because of that i have 2 options:

  1. i either use old school laravel route + blade templates and use vuejs for stuff like: sorting, filtering, pagination, searching, ...
  2. i use vue-router and load all pages as components (and their sub-components) at once (using: browserify, require, ...)

I'd really like to hear your thoughts on this.

Thank you.

0 likes
3 replies
adelin's avatar

Personally I decided to go with option 2.

Looks like you don't end up with such a huge file if you decide to bundle vuejs+it's html templates with browserify. If you also configure your server to compress it (gzip) and maybe even caching.. it's even better

simondavies's avatar

i'm currently looking into this now and having Laravel router etc run the front end of the site, while then having a admin section that is then solely run via Vue JS, and the only action then is Laravel will route to say site.com/admin, then Vue JS will then take over form there, using Laravel for the backend via ajax etc.

Laravel Routes used on public side of the site: www.site.com/, www.site.com/name-here etc

Laravel routes to the admin page then Vue JS form there www.site.com/admin/
Vue JS controlling the rest from there www.site.com/admin/sections-here

Please or to participate in this conversation.