Support the ongoing development of →
posted 9 years ago
Last updated 1 year ago.

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)

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.