Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 未定义的表错误:扩展用户';s插件_Php_Laravel_Octobercms_Octobercms Plugins - Fatal编程技术网

Php 未定义的表错误:扩展用户';s插件

Php 未定义的表错误:扩展用户';s插件,php,laravel,octobercms,octobercms-plugins,Php,Laravel,Octobercms,Octobercms Plugins,我试图扩展用户的表以向其添加更多字段,我将此作为我的代码保存在更新文件夹中的php文件中 <?php namespace Corymillz\Store\Updates; use Schema; use October\Rain\Database\Updates\Migration; class AddNewFeilds extends Migration { public function up() { Schema::table('users',

我试图扩展用户的表以向其添加更多字段,我将此作为我的代码保存在更新文件夹中的php文件中

<?php namespace Corymillz\Store\Updates;

use Schema;
use October\Rain\Database\Updates\Migration;

class AddNewFeilds extends Migration
{

    public function up()
    {
        Schema::table('users', function($table)
        {
            $table->string('store_title')->nullable();
            $table->text('store_description')->nullable();
            $table->string('background_color')->nullable();
            $table->string('font_color')->nullable();
            $table->string('font_family')->nullable();
            $table->dateTime('last_seen')->nullable();
        });
    }
    public function down()
    {
        $table->dropDown([

            'store_title',
            'store_description',
            'background_color',
            'font_color',
            'font_family',
            'last_seen'
        ]);
    }
}
我认为您的
down()
方法缺少代码

应该是这样的

在您的代码中,它抱怨
$table variable
,因为它没有定义,还需要使用
dropColumn

如果有任何疑问,请评论

public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn([
            'store_title',
            'store_description',
            'background_color',
            'font_color',
            'font_family',
            'last_seen'
        ]);
    });
}