Laravel 4 - Using renameColumn in controller

database-migration, doctrine, laravel, laravel-4, php

Solution

Add the `doctrine/dbal` dependency to your `composer.json` file.

For more information, it's on the very bottom of this page in the documentation.

http://laravel.com/docs/releases

Problem

I want to use artisan migration within my controller, like this ``` echo '<br>init migrate:install...'; Artisan::call('migrate'); echo 'done migrate:install'; ``` It works fine for all my table creations and etc. But there are problems when I try to use $table->renameColumn Laravel doc said I need to include doctrine/dbal, but how? I have tried `use Doctrine\DBAL\Driver\PDOMySql\Driver;` but no luck. FYI i cannot use CLI, my host doesn't provide any CLI to me. Here is my error ``` Symfony \ Component \ Debug \ Exception \ FatalErrorException Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found ``` UPDATE Same error when using terminal to migrate SECOND UPDATE An Example of migration code at 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'); }); } } ```

Original source

Related problems