jeudi 16 juin 2016

SQLSTATE[23000]: Integrity constraint violation error when inserting date to a table in Laravel 5

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">
     
</div> 
<div class="form-group"> 
     
</div>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire