Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JustinRijsdijk's avatar

Laravel API and seperate Vue frontend pusher integration

Hello,

I have built a Laravel API, and I want to make a vue front end for this. Would I have to put this frontend into a seperate laravel application for the laravel echo/pusher integration, or can I just create a normal Vue-CLI application?

0 likes
9 replies
bugsysha's avatar
bugsysha
Best Answer
Level 61

Would I have to put this frontend into a seperate laravel application for the laravel echo/pusher integration

You can but you can also put it into same Laravel app.

or can I just create a normal Vue-CLI application?

You can also go with this approach.

I decide based on the size of the app. If the app is going to be huge then I use one repo for Laravel API and one repo for Vue app created by Vue-CLI. But if it is going to be a small app then I leave everything in one repo created by laravel new.

1 like
JustinRijsdijk's avatar

In my case, there will be multiple (diffrent/custom) front-ends mady and maintained by me and my collegues. so it will have to be diffrent repo's. As for a follow-up question; How would I integrate this? Like the normal Laravel Echo way? or do I need to do it all by hand?

bugsysha's avatar

I would go with "normal Laravel Echo" way. I think that there is a tutorial here on Laracasts for Laravel Echo. You just have to adjust it a bit to your separate app setup for frontend and backend.

JustinRijsdijk's avatar

Another question, How would I return the CSRF to Vue? or is that not needed?

bugsysha's avatar

@justinrijsdijk CSRF is by default only required for routes that are in routes/web.php file. All routes within routes/api.php do not require CSRF (by default). If you changed something in the app/Http/Kernel.php for api routes regarding CSRF then I advise you to revert it to original state.

Please or to participate in this conversation.