I deployed everything here (both frontend and backend).
For the routes, I’m using relative paths from the same site at all times (no subdomains, everything on the same host). I’ve been trying different ways to handle them (fetch, Vue Router, and Inertia.js).
The API routes (mysite/api/games/apimethod
) all work perfectly, and so do the ones for creating. The ones giving me trouble are the update and delete routes. I’ve tried replicating the structure that worked for the others, but no luck.
For example (my edit game):
Route::put('/games/{game}/update', [UserGameController::class, 'update'])
->middleware('auth')
->name('gamesUser.update');
const payload = { ...this.form };
this.$inertia.put(`/games/${this.form.game_id}/update`, payload, {
onSuccess: () => {
this.$emit('close');
},
});
Locally, everything worked perfectly with fetch, router, and Inertia. I even tried using GET instead of PUT, but I still can’t see where it’s failing.
The same structure, for my add method (using POST), worked without a problem.
I also think it might be some issue with a dependency in vendor, since I use FileZilla to upload files, and each deploy takes 2 hours of waiting. Now that I’ve (mostly) gotten it to work, I’m afraid to break it—so I only upload the cache folder, modified files, and the build.
Sorry if my previous reply came off arrogant—I’m on a tight schedule and pretty stressed. Thanks again for trying to help me.