本文介绍了使用laravel-mongodb配置oauth2-server-laravel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将 oauth2-server-laravel 与 laravel-mongodb .使用此命令php artisan oauth2-server:migrations
生成迁移后,我尝试使用php artisan migrate
.但是我得到了这个错误.
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
此处的迁移代码
<?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()
它应该可以工作.
这篇关于使用laravel-mongodb配置oauth2-server-laravel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!