Configuring oauth2-server-laravel with laravel-mongodb

859 views Asked by At

I am trying to use oauth2-server-laravel with laravel-mongodb. After I generate migration using this command php artisan oauth2-server:migrations I tried to use php artisan migrate. But I got this error.

 [ErrorException]                                                             
  Missing argument 1 for  Illuminate\Database\Schema\Blueprint::primary(),
  called in
 /home/opu/www/cwc_penguins/app/database/migrations/2015_01_19_203037  
  _create_oauth_scopes_table.php on line 17 and defined 

2015_01_19_203037_create_oauth_scopes_table.php Migration code here

<?php

use Illuminate\Database\Schema\Blueprint;
use LucaDegasperi\OAuth2Server\Support\Migration;

class CreateOauthScopesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $this->schema()->create('oauth_scopes', function (Blueprint $table) {
            $table->string('id', 40)->primary();
            $table->string('description');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        $this->schema()->drop('oauth_scopes');
    }
}
2

There are 2 answers

0
user1840632 On

Remove this:

->primary()

And it should work.

0
David Weiner On

Or you can change it to ->primary('id') (or whatever the field name is). That's what I did.