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

oliverbusk's avatar

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:

enter image description here

As you can see in the above screenshot, I further have three actions:

  1. Previous record
  2. Skip record
  3. 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!

0 likes
0 replies

Please or to participate in this conversation.