For nested resources, we would typically have a URL format that references the parent record, e.g. POST to articles/{article}/images. This might delegate to a separate Controller, e.g. ArticleImageController:
Route::post('articles/{article}/images', [ArticleImageController::class, 'store']);
class ArticleImageController
{
public function store(Request $request, Article $article)
{
// store the image(s) associaged with the Article
}
}
I don't know what you understand by the correct way because nothing about the schema or routing/actions described would be conventional, e.g.
- why you have
image_idandimagescolumns on thearticlestable? - are the images being used by more than one Article?