i have two table one is user which is parent and other is posts(child) table and its coulmns are
public function up(){
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('title');
$table->string('body');
$table->timestamps();
}
}
i have already specified
$this->hasOne('Post');
relation into user model. now i want to insert data into posts table where with form i can save data into title and body column into there respective id's.