Search
 
SCRIPT & CODE EXAMPLE
 

PHP

add column in exesting table

php artisan make:migration add_paid_to_users_table --table=users

//You then need to use the Schema::table() method (as you're accessing an existing table, not creating a new one). And you can add a column like this:

public function up()
{
    Schema::table('users', function($table) {
        $table->integer('paid');
    });
}
//and don't forget to add the rollback option:

public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn('paid');
    });
}
//Then you can run your migrations:

php artisan migrate

Comment

PREVIOUS NEXT
Code Example
Php :: magento 2 create group programmatically 
Php :: wp_ajax_nopriv 
Php :: Writing a New Block for Cryptocurrency Blockchain 
Php :: php array_walk_recursive 
Php :: adding n days to a DATETIME format value 
Php :: Display out of stock products last (even after sort) - Woocommerce 
Php :: php pdo random multiple insert query 
Php :: fichiers en php 
Php :: laravel mix build as umd 
Php :: ring create an RSA key from PEM encoded string 
Php :: how to disable the plugins and theme editor 
Php :: custom post type wp 
Php :: php array of states in Nigeria 
Php :: How to Validate an Email Duplicate Entry in Codeigniter 
Php :: php parameters 
Php :: JsonResource::withoutWrapping 
Php :: make controller laravel history open link 
Php :: infoplist codepush key 
Php :: echo fread($myfile,filesize("webdictionary.txt")); 
Php :: avoid web crawling in Laravel 
Php :: QR CODE FROM CAMCODES 
Php :: newrelic notice err with custom attributes 
Php :: api key for getting youtube channel videos in php 
Php :: wc php order view order link 
Php :: laravel validation on gropu route 
Php :: number to words gujarati php 
Php :: laravel eloquent save method return value 
Php :: encrypt number 
Php :: execute query and use die in php 
Php :: php find longest string in array 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =