Structuring Inertia "actions" with Laravel
Hi!
I am using Inertia.js with Laravel.
I have a "mapping-editor page" on my website that is split in two editors. The first is the input, and the second editor is the output:
As you can see in the above screenshot, I further have three actions:
- Previous record
- Skip record
- Submit record
In my Editor.vue component, I have three methods that represents the above actions:
const previousRecord = () => {
//...
}
const skipRecord = () => {
//...
}
const submitRecord = () => {
//...
}
Now, I really cannot wrap my head around on how to structure the endpoints on the PHP/Laravel side for this, while keeping my controllers to the standard methods (resource controller). I don't want to add other custom methods to my controller, as I follow the "Cruddy by design-principle".
I have defined a controller for this "Editor" page:
Route::resource('pipelines.editor', EditorController::class);
I am in doubt on how to "capture" these actions in a controller, while keeping a clear (naming) convention.
What is the best practice here? Any input is highly appreciated!
Please or to participate in this conversation.
