Skip to main content

Posts

Showing posts from January, 2020

Laravel Migration (Update column, dropColumn) simplest and easiest way!

↬HOW TO UPDATE/DROP COLUMN WITHOUT LOOSING DATA?  ➥ LARAVEL MIGRATION: UPDATING A COLUMN WITHOUT LOOSING DATA:  Example: Suppose i have a database table which has this fields: id slider_title slider_description and the migration of that table looks like this: Schema::create('slide_cases', function (Blueprint $table) {   $table->bigIncrements('id');   $table->string('slider_title')->nullable();   $table->string('slider_description')->nullable();   $table->timestamps(); } ); Now, if i want to change the slide_description field data type from string to longText using laravel migration, simply do the following steps:  1) Open your command prompt and type:       php artisan make:migration update_slider_description_in_slide_cases --table=slide_cases ➽PLEASE KEEP IN  MIND that slide_cases is my table name; so you have to give your t...