Laravel 4 - Using renameColumn in controller

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');
        });
    }
}

Answers


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


Add doctrine/dbal dependency to your composer.json file, like

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

Then update composer using sudo composer update command, this will work.


Need Your Help

Why doesn't perf report cache misses?

linux caching optimization profiling perf

According to perf tutorials, perf stat is supposed to report cache misses using hardware counters. However, on my system (up-to-date Arch Linux), it doesn't:

C++ Boost async server handler being called with no connection

c++ multithreading sockets boost

I´m writing my first boost::asio async server and here is the code I put together: