uepg / laravel-sybase

Connection and Laravel Eloquent driver for Sybase
GNU General Public License v2.0
33 stars 16 forks source link

Call to undefined method Illuminate\Database\Query\Builder::blueprintResolver() #69

Open khleung opened 3 years ago

khleung commented 3 years ago

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.

khleung commented 3 years ago

I made the following changes and uepg/laravel-sybase plugins and it works now

  1. 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);
  2. Change in /vendor/uepg/laravel-sybase/src/Database/Schema/Grammar.php Line 5

Before : <?php

namespace Uepg\LaravelSybase\Database\Schema;

use Uepg\LaravelSybase\Support\Fluent; use Uepg\LaravelSybase\Database\Schema\Blueprint; use Illuminate\Database\Schema\Grammars\Grammar as IlluminateGrammar;

After : <?php

namespace Uepg\LaravelSybase\Database\Schema;

//use Uepg\LaravelSybase\Support\Fluent; use Illuminate\Support\Fluent; use Uepg\LaravelSybase\Database\Schema\Blueprint; use Illuminate\Database\Schema\Grammars\Grammar as IlluminateGrammar;

  1. Change in /vendor/uepg/laravel-sybase/src/Database/Schema/Grammar.php Line 183

Before : /**

After : /**