I'am trying to insert a date to a table but I got this message:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ('stagesite'.'internships', CONSTRAINT 'internships_contact_id_foreign' FOREIGN KEY
This is my code:
public function store( Request $request)
{
$input = $request->all();
$input['status_id'] = 1;
internship::create($input);
dd(' success ');
}
And that's my form:
<div class="form-group{{ $errors->has('contact') ? 'has-error' : '' }}">
{{ form :: select('course_id',$courses , null , ['id' => 'course_id', 'class' =>'form-control'] ) }}
</div>
<div class="form-group{{ $errors->has('contact') ? 'has-error' : '' }}">
{{ form :: hidden('contact_id',$contacts , null , ['id' => 'contact_id', 'class' =>'form-control'] ) }}
</div>