alphacheck's avatar

Vue integrate with Laravel

I am trying to develop a eCommerce Solution. The Client End / Front End has been designed by vue.js and it is working fine in my localhost.

Now I want to integrate this vue.js files with Laravel Code base. So that I could show the correct data using laravel to Vue.

Could you please help with step by step action I need to perform.

0 likes
1 reply
mikail10000000's avatar

So you have a single page app with vue and you need to do the api with laravel ?

First upload the app to resources/js Create a route / , tie a view to that route and in the view you need to create a basic html and load the vue app script src=mix("js/app.js)" or what ever your app is called , now you can use mix() if you compile your assets with mix which you should.

Now that your app is being served by laravel index page (if you cmd php artisan serve laravel should give you a url so you can see your app live by navigating to the url )

Next step is to write all the api calls or routes for your app so you can do the ajax calls from your vue app and get the correct data , if you have auth in your app than you need to get JWT or similar laravel packages to manage token based authentication , good luck ;)

Please or to participate in this conversation.