Answer the question
In order to leave comments, you need to log in
How to create deleted_at field for soft delete in existing db table?
Created a migration in which I prescribe the following.
The code is like this
public function up()
{
Schema::table('articles', function (Blueprint $table) {
//
$table->softDeletes();
});
}
public function down()
{
Schema::table('articles', function (Blueprint $table) {
//
$table->dropColumn('deleted_at');
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question