Configuring oauth2-server-laravel with laravel-mongodb

我的梦境 提交于 2019-12-11 03:55:13

问题


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');
    }
}

回答1:


Remove this:

->primary()

And it should work.




回答2:


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



来源:https://stackoverflow.com/questions/28039418/configuring-oauth2-server-laravel-with-laravel-mongodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!