Search
 
SCRIPT & CODE EXAMPLE
 

PHP

drop column table in migration if exist in laravel

Schema::table('users', function (Blueprint $table) {
     if (Schema::hasColumn('users', 'phone')) {
              $table->dropColumn('phone');
		}
});
Comment

PREVIOUS NEXT
Code Example
Php :: php ucwords 
Php :: php check if folder empty 
Php :: swich in php 
Php :: how get year of field database in laravel collection 
Php :: php get environment variable 
Php :: add new column in existing table in laravel migration 
Php :: seconds to days hours minutes seconds php 
Php :: remove 1 day from date in php 
Php :: how to write for loop in laravel blade 
Php :: laravel tinker add user 
Php :: php pass variable to anonymous function 
Php :: How to send data from PHP to Python 
Php :: laravel avoid logged in user to access a page 
Php :: convert text to slug php 
Php :: install php 7.4 ubuntu 
Php :: php get extension from file from form submit 
Php :: php array common element 
Php :: remove first character from string laravel 
Php :: laravel validation max string length 
Php :: grenerating random text color for text for image php 
Php :: show query in laravel 
Php :: Auth::routes(); why display error in route laravel 8 
Php :: string into integer php 
Php :: array_key_exists vs isset 
Php :: php clean all output buffers 
Php :: laravel eloquent get column 
Php :: In excel.php line 164: Class "MaatwebsiteExcelExcel" not found 
Php :: Laravel 9 Clear Cache of Route, View, Config, Event Commands 
Php :: get_transient wordpress 
Php :: php 2d empty array remove 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =