我正在尝试将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');
}
}
删除以下内容:
->primary()
它应该有效。
或者
你可以把它改成->primary('id')(或任何字段名称)。 这就是我所做的。