sgpatil / oriquent

Orientdb Eloquent driver for Laravel 5
MIT License
47 stars 15 forks source link

Hardcoded database configuration #3

Closed Dalamar closed 8 years ago

Dalamar commented 8 years ago

I came across following problem when was playing with your great project: I created my own DB in OrientDB and created migration file in Laravel. When I executed php artisan orient I got an exception:

  [Sgpatil\Orientphp\Exception]
  Error: Unable to create Class

Debugging showed that app always got response with code 401 (unauthorized) from OrientDB because it tried to access non existing database because you've hardcoded it in sgpatil/orientdb-laravel-5/src/Sgpatil/Orientdb/OrientdbServiceProvider.php:

Line: 39

$this->app->bind('ConnectionResolverInterface', function($app) {
            $conn = new Connection(['host' => 'localhost',
                'port' => 2480,
                'username' => 'root',
                'database' => 'graphdb2',
                'password' => 'root']);
            return new DatabaseManager($app, $conn );
        });

Line: 56

        $this->app->bind('orientdb.database', function() {
            return new Connection(['host' => 'localhost',
                'port' => 2480,
                'username' => 'root',
                'database' => 'graphdb2',
                'password' => 'root']);
        });

Please fix it and keep it going - this project is really awesome!

sgpatil commented 8 years ago

Hello @Dalamar thank you for your detailed information. The project is still in its initial phase. I will look into it and resolve it as early as possible. I genuinely appreciate your efforts and time. Feel free to submit a PR if possible, would really help.