1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

PHP: How to Add New Column to Existing Table in Laravel

  1. Clicks today:
    0
  2. Clicks this month:
    0
  3. Overall rating:
    0.00/5

PHP » Database Interactions — almost 2 years ago
Sometimes you need to add a new column to a table that already exists, for this we can use laravel migrations.

Comments

avatarnicknone almost 2 years ago

Use this link https://github.com/JeffreyWay/Laravel-4-Generators

Possible where mistake

in this code : <?php

/* * Run the migrations. * * @return void / public function up() { Schema::table('tasks', function(Blueprint $table) { $table->dropColumn('completed'); }); }

/* * Reverse the migrations. * * @return void / public function down() { Schema::table('tasks', function(Blueprint $table) { $table->boolean('completed'); }); }

}

but you can Change Content function (down to up) Thanks again alnutile to slove my problem from this link use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint;

class RemoveCompletedFromTasksTable extends Migration {

Your Comment

You must be logged in to post a comment.