小编Ion*_*dru的帖子

如何修复“Method Illuminate\Database\Schema\Blueprint::class 不存在”。

当我使用 php artisan migrate 时,我收到此消息。有人可以帮我弄这个吗?我在互联网上搜索,但没有找到任何对我有帮助的东西。(我是laravel的新手)

我的表:

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateServiceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('service', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('description');
            $table->string('icon');
            $table->class('class');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('service');
    }
}
Run Code Online (Sandbox Code Playgroud)

migration laravel

5
推荐指数
1
解决办法
2万
查看次数

我该如何解决这个错误“找不到接口 'Tymon\JWTAuth\Contracts\JWTSubject'”

我使用本指南制作 jwt-auth https://medium.com/mesan-digital/tutorial-4-how-to-build-a-laravel-5-4-jwt-powered-mobile-app-api-4c59109d35f 当我尝试注册用户时,我发现了这个问题。这是 composer.json 的要求

  "require": {
        "php": ">=7.1.3",
        "fideloper/proxy": "~4.0",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "tymon/jwt-auth": "1.0.0-rc.1"
    },
Run Code Online (Sandbox Code Playgroud)

这是user.php“

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;

class User extends Authenticatable implements JWTSubject
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', …
Run Code Online (Sandbox Code Playgroud)

php laravel jwt-auth

1
推荐指数
1
解决办法
6556
查看次数

标签 统计

laravel ×2

jwt-auth ×1

migration ×1

php ×1