drop column table in migration if exist in laravel

Solutions on MaxInterview for drop column table in migration if exist in laravel by the best coders in the world

showing results for - "drop column table in migration if exist in laravel"
Petar
03 Oct 2020
1if (Schema::hasColumn('users', 'phone')) {
2 	Schema::table('users', function (Blueprint $table){
3       $table->dropColumn('phone');
4    });
5}
Amélie
12 Jan 2017
1Schema::table('users', function (Blueprint $table) {
2     if (Schema::hasColumn('users', 'phone')) {
3              $table->dropColumn('phone');
4		}
5});
Ramon
10 Apr 2017
1Schema::table('users', function (Blueprint $table) {
2     $table->dropColumn('name');
3});
queries leading to this page
ms sql rename column check if existsdrop column laravel migrationdelete column if exists laraveldropcolumn if exists laravellaravel check if column existslaravel drop column if exists incrementlaravel migration drop if existsmigration drop table if exists laravelphp artisan drop column if existshow to make migration in laravel to drop column if existlaravel drop if column existsdrop column if exists laravellaravel migration drop if column existsdrop column in laravel migration if existslaravel drop table if existslaravel drop column if exists primary keylaravel drop column if table existlaravel blueprint if exists columnlaravwel migration has columndrop column if exists laravel migrationsdrop column with its check constraint laravel migration with microsoft sqldrop if exists laravel migrationlaravel check column existslaravel migration drop column if existslaravel check column exists or adddrop if exists laravel for existing columnlaravel migration delete data if existscheck if a column exists before dropping laravellaravel if column existslaravel eloquent check if column existscheck if column exists yajra datatablelaravel migration drop columnlaravel migration delete table if existsdrop column if exists laravel migrationlaravel migration check if column iexistsprint column if exits laraveldrop column if exist in laraveldrop column if it exists laravellaravel migrate table exist after deletelaravel does column existlaravel migration check if column existslaravel skip migration if table existsmigration check if column existsdrop table if exists laraveldrop column in migration in laravel 8laravel migration drop column if existscheck table has field laravellaravel drop if exists columnlaravel column existsdrop column in migration laravellaravel migration remove column throw error if existlaravel drop if column not existsverfy if table has column inlaraveldrop column in laravel migrationlaravel database migration drop column if existslaravel drop column if existslaravel check if table has columnlaravel drop column if exists migrationhow to make migration to drop column if existcheck if column exists in table laravellaravel dropcolumn if existslaravel drop column if exists relationcheck if column exist drop column laravel migrationlaravel migration drop table if existsdrop column table in migration if exist in laraveleloquent drop column if existscheck if deleted at column exists laraveldrop column table in migration if exist in laravel