laravel - 如何修复“方法 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');
}
}
解决方案
$table-> class ('class'); // 类不是类型。
推荐阅读
- python - 在 python 中使用日期和时间存储 OHLC 数据
- python-3.x - Python session.get 响应使用“latin-1”而不是“utf-8”编码
- jquery - Jquery Mobile:listview 远程自动完成官方演示不起作用
- c++ - gtkmm 多点触控设备无法识别 (Windows)
- powerbi - PowerBI:使用表中各个列的 SelectedValue 创建表
- javascript - Angular + Firebase - 组件在页面刷新时不保持身份验证状态
- flutter - 无法使用 HttpClient 从 Flutter Web 发布
- reactjs - Promise.all 错误 - 类型 '(Video | undefined)[]' 不可分配给类型 'Video[]'
- python - UnicodeEncodeError:“latin-1”编解码器无法在位置 14 编码字符“\u2013”:序数不在范围内(256)
- cpu - 当指令间的取指周期不同时,如何知道控制信号?