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

krs's avatar
Level 17

Adding InertiaJS to a big project

Hello to all!

Today I have a general question: I have an existing laravel project, most of it classy laravel backend with blade templates. The project so far has about 800+ routes. Additionally I use VueJS for about 50 single components, randomly distributed throughout the project.

Now I have to add a new module to this project, where client side reaction is used heavily (eg. user chooses a date, user instantly should see existing appointments of this day, etc). This leads to a VueJS component. BUT this new module consists of 6, 7 such components, and I am wondering if I could realize this using all the advantages of InertiaJS (which I already use in different projects - but from the start).

So, what I am wondering is - is it possible/safe to install InertiaJS to a project just to use it for a part of it? Or do I get problems with the inertia middleware in non-inertia-routes, ziggy with many routes, or... well... I don't know. Are there any adverse impacts related to the existing project?

Yes, I could (and I will) try it by myself, but maybe someone already has experience :-)

Thanks, Stefan

0 likes
8 replies
colbyalbo's avatar

The Inertia middleware and Ziggy routing helper should not affect the existing routes that are not using InertiaJS. However, you may need to make some adjustments to the existing VueJS components to work with InertiaJS, as the way data is passed between the client and server may change. 800+ routes, that must be a huge application! Just curious, what kind of traffic load does it get?

1 like
krs's avatar
Level 17

@colbyalbo Thanks for your thoughts; I mostly thought of the error handling of the validator, but of course I don't know by now if this justifies the effort of implementing inertia. Unless i migrate the whole project to inertiajs at some point in the future. Mhmmm... It's an application to manage (1) flexible lessons for pupils to be elected by them, and (2) weekly plans written by teachers for the pupils. I work on that since 4 yrs, it's live since 3 years and grows exponential :-) Traffic depends very much on the time of the day... when there are lessons where pupils work with their plans, we have around 6, 7 GB per hour. Since two weeks new server, and with Laravel Octane enabled :-) *fire!!!!so cool

2 likes
vincent15000's avatar

If you want to all the take advantage of InertiaJS, you have to consider that you have to manage the views like simple blade views.

For you example where a user chooses a date and instantaneously sees the existing appointments, InertiaJS won't give you any advantage because you will have to manage this reactivity with a simple axios request.

1 like
krs's avatar
Level 17

@vincent15000 Thanks you too for your ideas, I know about inertia, I use it by myself in other projects, I just wanted to know if anyone has experience in integration InertiaJS to an existing project (which isn't that small)... My current problem is handling validation exceptions gratefully with a classical VueJS component, so I thought of InertiaJS. But probably you're right and it's much simpler to put some effort into transfering the valiation errors back via the axios request...

1 like
vincent15000's avatar

@krs With InertiaJS the validation works exactly like with simple blade views.

krs's avatar
Level 17

@vincent15000 Yes that's exactly why I was thinking of implementing inertia in my project. Acutally I played around yesterday evening, and I implemented it myself in a very easy way... so I am one step back and away from installing inertia for this particular project.

But again, thanks to all for your ideas, good to know it should be possible to integrate InertiaJS into an existing big project without sideeffects...

dcranmer's avatar

@krs I'm in a similar situation. I'm looking at both Inertia and Nuxt as ways to better integrate the worlds of Laravel/Blade/traditional pages and Vue. Each revision seems to move more and more Blade templating to Vue, but there re still some places where the intersection of the two is really ugly. in the part of my site that uses Vue there are a lot of forms (also uses Pinia). Adding Vuelidate validation on top of Laravel validation works ok, but is kind of unwieldy and a fair amount of extra work. Maybe relying only on Laravel validation via axios requests is a good idea...?

krs's avatar
Level 17

@pweil Hi, I actually ended exactly here, I finally found that integrating InertiaJS is too much overhead (in this particular case) and I now use the usual Laravel validator, and I catch the messages via axios. Was not too much work actually, thought it would be more complicated...

Please or to participate in this conversation.