Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get to work with Laravel 5.4 #36

Open
1jason1 opened this issue Apr 3, 2017 · 19 comments
Open

Cant get to work with Laravel 5.4 #36

1jason1 opened this issue Apr 3, 2017 · 19 comments

Comments

@1jason1
Copy link

1jason1 commented Apr 3, 2017

ErrorException in Builder.php line 14:
Declaration of Sgpatil\Orientdb\Eloquent\Builder::has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Sgpatil\Orientdb\Eloquent\Closure $callback = NULL) should be compatible with Illuminate\Database\Eloquent\Builder::has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = NULL)

How do I get this to work, was using Neo4j but I want to try out OrientDb

@1jason1
Copy link
Author

1jason1 commented Apr 4, 2017

Clean install of Laravel 5.4

ErrorException in Connection.php line 20:
Declaration of Sgpatil\Orientdb\Connection::getConfig($option, $default = NULL) should be compatible with Illuminate\Database\Connection::getConfig($option = NULL)

What needs to be resolved?

@sgpatil
Copy link
Owner

sgpatil commented Apr 5, 2017

Hi @1jason1 , Thank you for using this library. I have made some changes in Connection.php to resolve the getConfig() problem. Can you please retry it by installing fresh copy. Also the project is still in development mode so you may get unexpected bugs while using. Let me know if this solved your problem.

@1jason1
Copy link
Author

1jason1 commented Apr 5, 2017 via email

@sgpatil
Copy link
Owner

sgpatil commented Apr 6, 2017

Hello @1jason1 , can you please try branch dev-master as I have made changes in that branch only.

@1jason1
Copy link
Author

1jason1 commented Apr 7, 2017 via email

@1jason1
Copy link
Author

1jason1 commented Apr 19, 2017 via email

@sgpatil
Copy link
Owner

sgpatil commented Apr 20, 2017

Hi @1jason1 , Actually I have tried the same code on fresh installation and everything is running properly in my system. Can you please tell me your system configuration like laravel version, Orientdb version, OS, Server, php version, screen shot of error message etc. This may help me to figure out the problem.

@1jason1
Copy link
Author

1jason1 commented Apr 20, 2017 via email

@1jason1
Copy link
Author

1jason1 commented Apr 20, 2017

Also, I get the following Warning when doing a Composer Update and at the point where composer is "Generating optimized autoload files" I get this Warning.

Warning: Ambiguous class resolution, "Sgpatil\Orientphp\Command\CreateClass" was found in both "/srv/www/test2/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Command/CreateClass.php" and "/srv/www/test2/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Command/MakeClass.php", the first will be used.

@tekarex
Copy link

tekarex commented Apr 21, 2017

I was also having this issue but it looks like the updates on dev-master fixed the issue. As @1jason1 mentioned, there is also the composer Ambiguous class resolution warning. Should we open a new issue for this?

@1jason1
Copy link
Author

1jason1 commented Apr 21, 2017

@rickvschmidt How did you get the errors to go away for Laravel 5.4? Not sure if you follow my config setup in prior posts but do I have my configs setup correctly? Are you able to register users and login via the auth package that Laravel provides by default?

In my composer.json in my require section I'm using the following, is this correct to pull the version your using?
"require": { "php": ">=5.6.4", "laravel/framework": "5.4.*", "laravel/tinker": "~1.0", "sgpatil/oriquent": "dev-master" },

@tekarex
Copy link

tekarex commented Apr 21, 2017

@1jason1 Not exactly yet, though I must admit that I am new to this package altogether. I have the same composer config as you do. I at least got past the original error you got while viewing the default Laravel view. I am currently having issues running any migrations... for me it is complaining that the database doesn't exist, while I am able to make a new model via Artisan orient:create

@tekarex
Copy link

tekarex commented Apr 21, 2017

@sgpatil I am unable to run any migrations. orient:install works fine, and is able to write to the DB, I am also able to call orient:create without issue. However, when I try to run a migration, I get the following error with the same configuration file setup... so I know the database exists and the drivers are able to connect. This running your latest dev-master branch and I am also on Laravel 5.4

[Sgpatil\Orientphp\Exception] database 'rick' does not exist. Please check database configuration. #0 /Users/Rick/code/orient-db-test/ven dor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Transport.php(114): Sgpatil\Orientphp\Transport\Curl->makeRe quest('GET', '/server', NULL) #1 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Command.php(67): Sgpat il\Orientphp\Transport->get('/server', NULL, NULL) #2 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Client.php(904): Sgpat il\Orientphp\Command->execute() #3 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Client.php(482): Sgpat il\Orientphp\Client->runCommand(Object(Sgpatil\Orientphp\Command\GetServerInfo)) #4 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Client.php(505): Sgpat il\Orientphp\Client->getServerInfo() #5 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Command/ExecuteBatchQu ery.php(82): Sgpatil\Orientphp\Client->hasCapability('cypher') #6 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Command.php(63): Sgpat il\Orientphp\Command\ExecuteBatchQuery->getPath() #7 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Client.php(904): Sgpat il\Orientphp\Command->execute() #8 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Client.php(237): Sgpat il\Orientphp\Client->runCommand(Object(Sgpatil\Orientphp\Command\ExecuteBatchQuery)) #9 /Users/Rick/code/orient-db-test/vendor/sgpatil/orientdb-php/src/Sgpatil/Orientphp/Batch/Query.php(58): S gpatil\Orientphp\Client->executeBatchQuery(Object(Sgpatil\Orientphp\Batch\Query)) #10 /Users/Rick/code/orient-db-test/vendor/sgpatil/oriquent/src/Sgpatil/Orientdb/Schema/OrientdbBuilder.php (15): Sgpatil\Orientphp\Batch\Query->getResultSet() #11 /Users/Rick/code/orient-db-test/vendor/sgpatil/oriquent/src/Sgpatil/Orientdb/Migrations/DatabaseMigrati onRepository.php(137): Sgpatil\Orientdb\Schema\OrientdbBuilder->hasTable('migrations') #12 /Users/Rick/code/orient-db-test/vendor/sgpatil/oriquent/src/Sgpatil/Orientdb/Migrations/Migrator.php(37 8): Sgpatil\Orientdb\Migrations\DatabaseMigrationRepository->repositoryExists() #13 /Users/Rick/code/orient-db-test/vendor/sgpatil/oriquent/src/Sgpatil/Orientdb/Console/Migrations/Migrate Command.php(102): Sgpatil\Orientdb\Migrations\Migrator->repositoryExists() #14 /Users/Rick/code/orient-db-test/vendor/sgpatil/oriquent/src/Sgpatil/Orientdb/Console/Migrations/Migrate Command.php(61): Sgpatil\Orientdb\Console\Migrations\MigrateCommand->prepareDatabase() #15 [internal function]: Sgpatil\Orientdb\Console\Migrations\MigrateCommand->fire() #16 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) #17 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #18 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object( Closure)) #19 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Container/Container.php(531): I lluminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #20 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illum inate\Container\Container->call(Array) #21 /Users/Rick/code/orient-db-test/vendor/symfony/console/Command/Command.php(262): Illuminate\Console\Com mand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #22 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfo ny\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illumin ate\Console\OutputStyle)) #23 /Users/Rick/code/orient-db-test/vendor/symfony/console/Application.php(826): Illuminate\Console\Command ->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOut put)) #24 /Users/Rick/code/orient-db-test/vendor/symfony/console/Application.php(190): Symfony\Component\Console\ Application->doRunCommand(Object(Sgpatil\Orientdb\Console\Migrations\MigrateCommand), Object(Symfony\Compon ent\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #25 /Users/Rick/code/orient-db-test/vendor/symfony/console/Application.php(121): Symfony\Component\Console\ Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Outp ut\ConsoleOutput)) #26 /Users/Rick/code/orient-db-test/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(1 23): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(S ymfony\Component\Console\Output\ConsoleOutput)) #27 /Users/Rick/code/orient-db-test/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfon y\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #28 {main}

@Shanery
Copy link

Shanery commented Apr 26, 2017

I simply get

[ReflectionException]
Class db does not exist

@sgpatil
Copy link
Owner

sgpatil commented Apr 27, 2017

@rickvschmidt, Is your .env file is configured properly ? It should be like

DB_CONNECTION=orientdb
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=orientdb_database
DB_USERNAME=orientdb_username
DB_PASSWORD=orientdb_password

@tekarex
Copy link

tekarex commented Apr 27, 2017

@sgpatil Yes, I have changed it. For some reason it requires Root access in order to properly work (not sure if this is by design, though I find it strange that admin access is not adequate). Once everything is switched over to root, the database not found error goes away, but then I get the error that @1jason1 gets (first post in this thread) when trying to use a basic auth page produced by Laravel. It appears there are some updates to be done to make the query builder work with Laravel 5.4.

@1jason1
Copy link
Author

1jason1 commented May 2, 2017

So I've tried all I can to get this driver to work with Laravel 5.4, I really like OrientDb vs Neo4j. I have a large social media type project that would work better under OrientDb but there just doesn't seem to be the right support for drivers yet for Laravel. Can anyone point me in the direction of another driver option before I have to go the Neo4j route?

@sgpatil
Copy link
Owner

sgpatil commented May 2, 2017

Sorry @1jason1, Unfortunately there are no perfect orientdb driver for laravel. You may contribute to this to build that one, PRs are always welcome. Due to ongoing projects I am not able to give full time to this project. Even I also wanted such a driver for one of my project which I have built using Neo4j (NeoEloquent Driver). Hope to build it better.

@1jason1
Copy link
Author

1jason1 commented May 2, 2017

@sgpatil I didn't mean to come off rude in my comment so I apologize if I did and thank you for the work you have done on this. I would like to help out, do you have any documentation on a recommend path to making the driver?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants