xxxxxxxxxx
php artisan make:migration add_company_id_to_users_table
//in up() method
Schema::table('users', function (Blueprint $table) {
$table->unsignedBigInteger('company_id');
});
//in down() method
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('company_id');
});
xxxxxxxxxx
php 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
xxxxxxxxxx
php artisan make:migration add_store_id_to_users_table --table=users
xxxxxxxxxx
php artisan make:migration add_paid_to_users_table --table=users
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');
});
}
xxxxxxxxxx
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}
xxxxxxxxxx
Schema::table('table_name', function (Blueprint $table) {
$table->string('column_name', 255)->nullable()->after('previous_column_name');
});
xxxxxxxxxx
require('dotenv').config()
console.log(process.env) // remove this after you've confirmed it is working
xxxxxxxxxx
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid');
});
}
xxxxxxxxxx
must install dotenv package from terminal using
yarn add --dev dotenv
// this is under config.js
require("dotenv").config();
// RPC_url & Private key masked by dotenv
const GOERLI_RPC_URL = process.env.GOERLI_RPC_URL;
const PRIVATE_KEY = process.env.PRIVATE_KEY;
// This are under .env
GOERLI_RPC_URL = https://eth-goerli.g.alchemy.com/v2/QQCTg89Ei5ZfBUQ0Y5g0j_aN2PwmwX67
PRIVATE_KEY = f8494e7b7d5a8bd284150015ac99074c12ff3d7f06d574c837ea6a2a78918a17
ETHERSCAN_API_KEY = C419PC8HGZ6ZA7V3K41A9YRWTDMD3XDYCB