Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 199 forks source link

db migrations not working in laravel 5.3 and NeoEloquent 1.4 #179

Closed AzeemMichael closed 7 years ago

AzeemMichael commented 7 years ago
  1. Getting [BadMethodCallException] Method lists does not exist. on php artisian neo4j:migrate
  2. The command php artisian neo4j:migrate:reset runs into an infinite loop with a message Nothing to rollback.
heydavid713 commented 7 years ago

Can you paste the stack trace for the error?

ghost commented 7 years ago

For the people that have laravel 5.3 and use NeoEloquent 1.4 or up. There is this method called lists which is replaced by pluck. Go to your vendor\vinelab\neoeloquent\src\Vinelab\NeoEloquent\Migrations and go to DatabaseMigrationRepository.php

public function getRan() { return $this->model->all()->lists('migration')->toArray(); }

Change it to

public function getRan() { return $this->model->all()->pluck('migration')->toArray(); }

and you're all set.

(I took 4 hours to fix this.. )

Mulkave commented 7 years ago

@dennisvanvalderen sorry to hear you spent all that time 😞 will fix and push

Mulkave commented 7 years ago

v1.4.1 has been released with the fix suggested by @dennisvanvalderen. A composer update should do the trick.