I am getting following error while saving the data in the pivot table
Not null violation: 7 ERROR: null value in column "created_at" violates not-null constraint DETAIL: Failing row contains (4, 10, 16, null, null). (SQL: insert into "child_packages" ("child_id", "package_id") values (10, 16))
here is my code for saving data in the table
$child = $this->child_section->create($input);
$packages_ids = Input::get('package_id');
$child->Packages()->sync($packages_ids);
and in the child model
public function Packages()
{
return $this->belongsToMany('FoodPackage');
}
For database I am using postgresql