relationship on a resource

I need a relationship on a resource, my main table is "employee", my secondary table is "employeeJob" this get "employee_id", what I try to do is that my form obtains the data from the "employeeJob" table, so that I can also edit them with the other records of "employee", its posible?.

try to do something like this: look picture

for saved the data, i use: protected function handleRecordCreation(array $data): Model
{
$employee = static::getModel()::create($data);
$current_date = Carbon::today();
$job = Job::where('id', $data['job_id'])->first();

$job = EmployeeJob::create([
'employee_id' => $employee->id,
'job_id' => $data['job_id'],
'title' => $job->name,
'type' => $data['type'],
'payment_amount' => $data['payment_amount'],
'payment_unit' => $data['payment_unit'],
'start_date' => $current_date
]);

return $employee;
}
image.png
Was this page helpful?