laravel create table with model code example

Example 1: laravel migration remove column

public function up()
{
  Schema::table('table', function($table) {
    $table->dropColumn('column_name');
  });
}

Example 2: create laravel migration

php artisan make:migration create_users_table

Example 3: laravel create model and migration

# If you would like to generate a database migration when you 
# generate the model, you may use the --migration or -m option:

php artisan make:model Flight --migration
php artisan make:model Flight -m

Example 4: laravel create table with model command line

php artisan make:model Create_table -m

Example 5: laravel drop table migration

Schema::drop('users');

Schema::dropIfExists('users');

Example 6: create table laravel

php artisan make:migration create_employeeDetails_table --create=Employee
//goto create_employeeDetails_table file and add fields in table
php artisan migrate