In case anyone else stumbles across this...
$tbl
is outside of the anonymous function's scope that is being passed to the Schema::table
method. In order to access it within the anonymous function add use ($tbl)
after the function's parameter definition:
Schema::table($tbl['tableName'], function(Blueprint $table) use ($tbl) {
foreach ($tbl['foreignKeys'] as $key)
{
$table->dropForeign($tbl['tableName'].'_'.$key.'_foreign');
}
...
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community