Step 1: Run the following command to create a migration file. php artisan make:migration alter_users_table (here users is the existing table name) Step 2: Now check your application. 1 migration file is created in path database/migrations. The file name is like : 2018_09_10_102106_alter_users_table Here we will add 1 'user_type' field to users table. Open that migration file and write the following in up() function. Schema::table('users', function($table) { $table->string('user_type'); }); Step 3: now run the following command & check your table. user_type field is added to your table. php artisan migrate
- Home
- About
- Python
- Laravel
- Setup Laravel Project In Localhost
- Install Laravel In MAC OS
- How To Install Laravel Via Composer
- Connect To MySQL Database In Laravel?
- Get All Records In Laravel
- Add New Column To Existing Table In Laravel Using Migration
- Insert, Edit, Update, View & Delete Records In Laravel For Beginners
- How To Seed Database Using Faker Library In Laravel
- Create A Resource Controller In Laravel
- ReflectionException Class ClassName Not Found Laravel
- Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) . Class ‘App\Http\Controllers\DB’ Not Found.
- Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException Error Fix In Laravel
- Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class ‘App\Http\Controllers\Redirect’ Not Found
- Anguar
- Drupal
- Quiz
- Interview Questions
- Contact