Schema\Builder ignores custom Blueprint resolver
Paasky opened this issue · 2 comments
Paasky commented
Found this in a project I'm working on that uses a custom extension of \Illuminate\Database\Schema\Blueprint
The original Builder in vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php has a function
protected function createBlueprint($table, Closure $callback = null)
{
$prefix = $this->connection->getConfig('prefix_indexes')
? $this->connection->getConfig('prefix')
: '';
if (isset($this->resolver)) {
return call_user_func($this->resolver, $table, $callback, $prefix);
}
return new Blueprint($table, $callback, $prefix);
}
In the extension in https://github.com/grimzy/laravel-mysql-spatial/blob/master/src/Schema/Builder.php the function is overridden:
protected function createBlueprint($table, Closure $callback = null)
{
return new Blueprint($table, $callback);
}
The original part
if (isset($this->resolver)) {
return call_user_func($this->resolver, $table, $callback, $prefix);
}
is what uses a custom Blueprint resolver if it was given.
Is there a specific reason why the override omits parts of original functionality? Perhaps it was just overriden so long ago that the Laravel function has gained extra bits?
Otherwise great package, been using it in several projects ;)