When we have an Identifier name on the foreign key is a too-long error we can set name ourselves.
Note:
Max foreign char size is 64
Example:
Before:
$table->foreign('risk_project_id',)->references('id')->on('business_risk_projects')->onDelete('restrict');
Solution:
$table->foreign('risk_project_id', 'business_rp_has_responsible_persons_risk_project_id_foreign'
)->references('id')->on('business_risk_projects')->onDelete('restrict');
Just add a second parameter to the foreign() method with the name of the key