Question : laravel migration remove column
Answered by : faithful-fish-4uu3s6wj4zll
public function up()
{ Schema::table('table', function($table) { $table->dropColumn('column_name'); });
}
Source : | Last Update : Thu, 23 Apr 20
Question : laravel schema add column
Answered by : tushar-saha-7scjp0835tdc
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Schema::table($tableName, function (Blueprint $table) { $table->string("title"); $table->text("description"); $table->float('old_price')->default('0.00')->after('price');
});
Source : | Last Update : Thu, 15 Feb 24