How would i make a single request to insert in multiple tables using laravel Eloquent ORM relationship .ie
Table 1 : users
- id
- name
Table 2 : posts
- id
- user_id
- content
Table 3 : Image
- id
- user_id
- post_id
- image_name
relationship
- Table
users
id referencesuser_id
in other two tables . - Table
posts
has One To Many relation withusers
. - Table
images
has One To Many relation withusers
andpost
ie it can be shared with other users and on other posts.
So that when one makes a post insert ,it should insert the record in the tables with a single query.