laravel migration softdelete

28

$ php artisan make:migration add_soft_deletes_to_user_table --table="users"}
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
 
Schema::table('flights', function (Blueprint $table) {
    $table->softDeletes();
});
 
Schema::table('flights', function (Blueprint $table) {
    $table->dropSoftDeletes();
});
use Illuminate\Database\Eloquent\SoftDeletes;class User extends Model {use SoftDeletes;    protected $dates = ['deleted_at'];}
>>> $test->forceDelete();
=> true

Comments

Submit
0 Comments