Skip to content

Instantly share code, notes, and snippets.

@abdullahseba
Created February 8, 2017 17:08
Show Gist options
  • Save abdullahseba/4da528bbdef40e919a7dde61ea3083bb to your computer and use it in GitHub Desktop.
Save abdullahseba/4da528bbdef40e919a7dde61ea3083bb to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Schema\Blueprint;
/**
* Comments Column
*/
if (!$schema->hasColumn('users', 'comments')) {
$schema->table('users', function(Blueprint $table)
{
$table->string('comments');
});
echo "Created column 'comments'..." . PHP_EOL;
} else {
echo "Column 'comments' already exists. Skipping..." . PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment