Yes, the data comes from a form, the problem is that the first entry needs to be in table Entity, then Company and then Supplier, like this:
$entity = new Entity(); $entity->save();
$company = new Company(); $company-entity_id = $entity->id; $company->save();
$supplier = new Supplier(); $supplier->entity_id = $entity->id; $supplier->legal_name = Request::input('legal_name'); $supplier->email = Request::input('email'); $supplier->phone = Request::input('phone'); etc... $supplier->save();
Is there an alternative way to achieve this in Laravel?