【问题标题】:Configuring oauth2-server-laravel with laravel-mongodb使用 laravel-mongodb 配置 oauth2-server-laravel
【发布时间】:2016-06-26 21:31:54
【问题描述】:

我正在尝试将oauth2-server-laravellaravel-mongodb 一起使用。使用此命令php artisan oauth2-server:migrations 生成迁移后,我尝试使用php artisan migrate。但我得到了这个错误。

 [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这里是迁移代码

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

【问题讨论】:

标签: php mongodb laravel-4 oauth2-server


【解决方案1】:

删除这个:

->primary()

它应该可以工作。

【讨论】:

    【解决方案2】:

    或者您可以将其更改为 ->primary('id') (或任何字段名称)。我就是这么做的。

    【讨论】:

      猜你喜欢
      • 2015-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-02
      • 2015-11-25
      • 2016-06-07
      • 2020-07-20
      • 2016-07-10
      相关资源
      最近更新 更多