Answers for "create migrate column only but not include delete logic laravel 8"

PHP
1

drop column table in migration if exist in laravel

Schema::table('users', function (Blueprint $table) {
     if (Schema::hasColumn('users', 'phone')) {
              $table->dropColumn('phone');
		}
});
Posted by: Guest on August-04-2021

Code answers related to "create migrate column only but not include delete logic laravel 8"

Browse Popular Code Answers by Language