Hi is there any way to insert data in two tables in one request laravel nova belongsTo relation What I am trying to achieve is that I have two models first is the user model & the second one is the student Model User model has email and password And student model has other profiling details of a student when a student is created I need to insert a record in the user's table as well and relate that inserted entity with my student detail like some entity go into student details and some in user model related with authentications I am trying to achieve this with laravel nova.
HERE IS USER MODEL RELATIONSHIP WITH STUDENTS
public function students(){
return $this->hasMany('App\student','user_id','id');
}
HERE IS STUDENT MODEL RELATIONSHIP WITH USER
public function user(){
return $this->belongsTo('App\User','user_id','id');
}
I also tried to use nova belongs to field but it gives me dropdown with existing users but I want to create user and student both on the fly in one go and link them with each other https://nova.laravel.com/docs/2.0/resources/relationships.html#belongsto
I hope i clarify my point thanks if anything feels free to ask or collaborate thanks