yes, I am doing in migration. when I run PHP artisan migrate command it is giving me below error
Migrating: 2019_08_17_070731_add_foreign_key
Illuminate\Database\QueryException : SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (schoolmanagement.#sql-314_2c, CONSTRAINT students_parentsid_foreign FOREIGN KEY (parentsid) REFERENCES parent_names (id) ON DELETE CASCADE) (SQL: alter table students add constraint students_parentsid_foreign foreign key (parentsid) references parent_names (id) on delete cascade)
at C:\xampp\htdocs\schoolmanagement\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {