I've been getting into using Laravel and I'm still new to migrations. What I'm trying to do is how to perform the record of multiple tables in the database?
For example:
I have the login table
login[idusuario,nombre, contraseña]
I have the employee table
[idEmpleado, nombre, apPaterno, idusuario]
What I don't understand is how to register these two since the employee table requires a foreign login key. In my controller register I have this:
public function store(Request $request)
{
Login::create($request->all());
}
With this I make the login data to be recorded first and then pass the primary key as foreign in the employees table, from here I don't know how to continue. Any suggestions?
I think you are confused with what refers to migrations, but with the problem you are doing well, when you create your user you only have to store it in a variable
from there just create your arrangement for the employee