You must create a migration containing the new columns you want to add to your DB schema.
Example: (this will add a TINYINT admin
column with 0
as default value)
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddsAdminColumnToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->tinyInteger('admin')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('admin');
});
}
}
Read more about Laravel Migrations here.
admin
column in youUser
table. – Prashant Deshmukh.....User
model in question – Jignesh Joisar