【发布时间】:2016-06-26 21:31:54
【问题描述】:
我正在尝试将oauth2-server-laravel 与laravel-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');
}
}
【问题讨论】:
-
这是一个有效的实现github.com/pengkong/oauth2-server-laravel,只需将 app.php 中的服务提供者更改为 LucaDegasperi\OAuth2Server\Storage\Mongo\FluentStorageServiceProvider::class,
标签: php mongodb laravel-4 oauth2-server