add a new column to existing table in a migration
// for Laravel 5+
php artisan make:migration add_email_to_users_table --table=users
public function up()
{
Schema::table('users', function($table) {
$table->integer('email');
});
}
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('email');
});
}
php artisan migratephp artisan make:migration add_paid_to_users_table --table=usersphp artisan make:migration add_paid_to_users_table --table=users
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid');
});
}
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}
php artisan migrate
Also in PHP:
- echo in console php
- check isset key in array php
- check value contains numbers or letters php
- Deleting an element from an array in PHP
- alert js in php
- age php datetime
- check type of result php
- decode_id php
- artisan call route clear
- date + 1 day in php
- array_key_exists() WORDPRESS
- php uppercase
- capitalize letter in php
- check if model already contain words
- delete file using php
- /DependencyResolver/Solver.php on line 223
- Create a function that converts string to lowercase
- does include reload the page php
- error reporting 0 in php
- clear cache config laravel
- date format php datetime
- clear all cahceh daat in laravel
- enable reporting php development mode
- Create image data URIs (base64) using PHP Raw