Frage

When I try to run php artisan migrate to migrate a missing migration to my database. I get the following exception:

[BadMethodCallException]
Call to undefined method Illuminate\Database\Query\Builder::up()

See down to get the complete log and stack trace.

I run the command on the console local on my own computer. But on my server it does not work either.

I have tried already the following: 1. composer update 2. artisan dump-autoload 3. Delete /vendor and do composer install

This (https://github.com/cartalyst/sentry/issues/257) has not helped because i don't have a compile.php file. (Cause on local development this is disabled by default from laravel.)

If you need more informations like the complete migration code. Please ask.

This is the complete stack trace from the log http://snippi.com/s/lz5z86f (I have put it into a snippet cause it is quite long.)

War es hilfreich?

Lösung

I had another class which had the same filename like the migration.

Cause of this the exception was thrown. Renaming and executeing artisan dump-autoload helped.

Andere Tipps

I had the same problem and then I realized that my migrations filename differed from the class name and that fixed the problem for me. Try that one.

Could you show us your migration since the Exception tells you that the method used for creating the tables etc. is not there. In every migration the layout should look something like this:

public function up() {

    Schema::create('users', function($table)
    {
        $table->increments('id');
    });

}

public function down() {

    Schema::drop('users');

}

Maybe you are calling a Class instead of the ClassSeeder in your DatabaseSeeder or Seeder

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top