#Correct HTTP response codes for SPA routes
17 messages · Page 1 of 1 (latest)
Also, that string syntax for the route action has not been used in the docs for quite some time, I would advice not to use it
I have no clue what you're saying really.. You have one single route that does litterally everything in your app? From returning posts, to returning comments to whatever..?
have you considered inertia? if duplicating routes is your issue & your just using Vue & not Nuxt.
ALso im not really sure what your saying with this catch all controller thing either 🤷♂️
Yeah, still no clue what you're actually asking here.
sound like a Route::fallback?
But what do you mean rewriting if you don't have a backend, with pages of routes & many controllers?
Confused...
A fallback route is just a catch-all route, essentially the same as what's defined in the OP
Okay so now it makes a bit more sense. Then no, your routes are probably defined with the Vue-Router, so that's client-side. Then there's no way to know server-side if that route exists client-side
say Ziggy without saying Ziggy...
That's the other way around.
true...
Guess you could take that approach, define your routes server-side, then pass them to your JS app and initialize the router with those routes. Then in your controller you can check if the routes exist
But in all honesty, this sounds like a whacky solution and you might be better off taking the Breeze Nuxt + API approach
But I suggested a solution
And the way Breeze does it as an alternative, that wouldn't be an enormous undertaking either I guess (at least way less than Inertia), it would mean to stip out your Vue app and make it a separate repo, serve the Vue app and just use your Laravel app as API, the same way the Breeze/Nuxt combo does it