I have the following code.
function up() {
$runafterupdate = [];
Schema::connection('exitproducts')->create('exitcontrol_carmanager_manager', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('code');
$runafterupdate['code'] = true;
$table->timestamps();
});
}
if(isset($runafterupdate['code'])) {
echo "it worked!";
}
}
And i'm used to JavaScript where you can alter the values of the parent scope, but aparently php follows different rules. I've tried reading through http://php.net/manual/en/language.variables.scope.php but I really don't want to use globals.
Is there a way to alter the variables in the parent scope with php or is my only resort in this case a global variable?