Call to undefined method Illuminate\Database\Query\Builder::blueprintResolver()
Opened this issue · 1 comments
My existing Laravel 5.7 + laravel-sybase project works very well with a SAP ASE 16.0.x database connectivity
On the same machine, I just created a new Laravel project and applied laravel-sybase with the guidelines given.
$ php artisan -v
Laravel Framework 7.26.1
$ php artisan migrate -v
BadMethodCallException
Call to undefined method Illuminate\Database\Query\Builder::blueprintResolver()
at vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50
46| * @throws \BadMethodCallException
47| */
48| protected static function throwBadMethodCallException($method)
49| {
50| throw new BadMethodCallException(sprintf(
51| 'Call to undefined method %s::%s()', static::class, $method
52| ));
53| }
54| }
• Bad Method Call: Did you mean Illuminate\Database\Query\Builder::useWritePdo() ?
1 vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3222
Illuminate\Database\Query\Builder::throwBadMethodCallException("blueprintResolver")
2 vendor/uepg/laravel-sybase/src/Database/Connection.php:849
Illuminate\Database\Query\Builder::__call("blueprintResolver")
3 vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:167
Uepg\LaravelSybase\Database\Connection::getSchemaBuilder()
4 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:608
Illuminate\Database\Migrations\DatabaseMigrationRepository::repositoryExists()
5 vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:93
Illuminate\Database\Migrations\Migrator::repositoryExists()
6 vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:64
I have no idea to fix it . please advise.
I made the following changes and uepg/laravel-sybase plugins and it works now
- Change in vendor/uepg/laravel-sybase/src/Database/Connection.php
diff vendor/uepg/laravel-sybase/src/Database/Connection_old.php vendor/uepg/laravel-sybase/src/Database/Connection.php
8a9
use Illuminate\Database\Schema\Builder as SchemaBuilder;
802c803
<
837c838
< * @return \Illuminate\Database\Query\Builder
* @return \Illuminate\Database\Schema\Builder
845c846
< $builder = new Builder($this);
$builder = new SchemaBuilder($this);
- Change in /vendor/uepg/laravel-sybase/src/Database/Schema/Grammar.php Line 5
Before :
getTable() . "' ) DROP TABLE " . $blueprint->getTable(); } After : /** * Compile a drop table (if exists) command. * * @param \Uepg\LaravelSybase\Database\Schema\Blueprint $blueprint * @param \Uepg\LaravelSybase\Support\Fluent $command * @return string */ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) { return " IF EXISTS ( SELECT * FROM sysobjects WHERE type = 'U' AND name = '" . $blueprint->getTable() . "' ) DROP TABLE " . $blueprint->getTable(); }