2015-01-20 4 views
2

Я пытаюсь использовать oauth2-server-laravel с laravel-mongodb. После создания миграции с помощью этой команды php artisan oauth2-server:migrations Я попытался использовать php artisan migrate. Но я получил эту ошибку.Настройка oauth2-server-laravel с laravel-mongodb

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

вот работающая реализация https://github.com/pengkong/oauth2-server-laravel, чтобы просто изменить поставщика услуг в app.php на LucaDegasperi \ OAuth2Server \ Storage \ Mongo \ FluentStorageServiceProvider :: class, –

ответ

0

Или вы можете изменить его на -> primary ('id') (или любое другое имя поля). Вот что я сделал.

Смежные вопросы