2

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');
    }
}
Md. Al-Amin
  • 1,423
  • 1
  • 13
  • 26
  • here's a working implementation https://github.com/pengkong/oauth2-server-laravel to use just change the service provider in app.php to LucaDegasperi\OAuth2Server\Storage\Mongo\FluentStorageServiceProvider::class, – PK. Dec 04 '15 at 13:51

2 Answers2

1

Remove this:

->primary()

And it should work.

0

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