Here we will discuss how to create soft delete migration.
Laravel softDeletes migration
Laravel migration softDeletes() method create a deleted_at name column which is TIMESTAMP type column. You can also modified this column name by passing in first argument. This column store a date time when data soft delete.
public function up() { Schema::create('users', function (Blueprint $table) { $table->softDeletes(); // create delete_at column $table->softDeletes('custom_name'); // create custom_name timestamp column }); }
Read Also : Laravel union of two queries