I am setting up laravel passport on a api project. I try to follow the steps on this site but couldn't get the authenication to work.
The requesting a token part seems to work fine. When making a call to http://127.0.0.1:8000/oauth/token, it return a valid token.
When I send a request to the api with the token in the Authorization Header, it gives a column "api_token" does not exit error
Authorization Header: Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni........
Error:
"SQLSTATE[42703]: Undefined column: 7 ERROR: column "api_token" does not exist↵LINE 1: select * from "users" where "api_token" = $1 limit 1↵
Do I need to create the api_token column myself? I used the default migration file to create the table. This is the migration file for the users table
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}