Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/271.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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 Laravel 4-在控制器中使用重命名列_Php_Laravel_Doctrine_Laravel 4_Database Migration - Fatal编程技术网

Php Laravel 4-在控制器中使用重命名列

Php Laravel 4-在控制器中使用重命名列,php,laravel,doctrine,laravel-4,database-migration,Php,Laravel,Doctrine,Laravel 4,Database Migration,我想在控制器中使用artisan迁移,如下所示 echo '<br>init migrate:install...'; Artisan::call('migrate'); echo 'done migrate:install'; 更新 使用终端迁移时出现相同错误 第二次更新 app/database/migrations上的迁移代码示例 use Illuminate\Database\Migrations\Migration; class UpdatePostsTable ext

我想在控制器中使用artisan迁移,如下所示

echo '<br>init migrate:install...';
Artisan::call('migrate');
echo 'done migrate:install';
更新

使用终端迁移时出现相同错误

第二次更新

app/database/migrations上的迁移代码示例

use Illuminate\Database\Migrations\Migration;

class UpdatePostsTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('user', function($table)
        {
            $table->renameColumn('fullname', 'full_name');
        });
    }
}

doctor/dbal
依赖项添加到
composer.json
文件中

有关更多信息,请参见本页文档的最底部


原则/dbal依赖项添加到composer.json文件中,如

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "illuminate/html": "5.*",
    "doctrine/dbal": "~2.3"
},

然后使用sudo composer update命令更新composer,这将起作用。

您能在终端中正常运行它吗?@DennisBraga不能。我收到同样的错误。有什么想法吗?请发布你的迁移代码。如果你像我一样,不知道如何添加这种依赖关系,这里有一个链接可以找到答案。向composer.json文件中添加条令/dbal依赖项也很好,请参考已接受的答案。
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "illuminate/html": "5.*",
    "doctrine/dbal": "~2.3"
},