使用hasColumns laravel更改数据库表

I have a table called table1 and columns named id, name,field1, field2, field3.

And i want to check the columns are exist. If any one of the column does not exist, i want to add that columns to the table.

Eg: i have column names called id, name,field1, field2, field3. And i want to check is there any columns named field3, field4, field5. In this field3 exists and other 2 are not. so i want to add that 2 columns in table1 table. Is this possible using hasColumns?. Or suggest me other ways?

Inside the controller's method write the following code:

    \Schema::table('table1', function (\Illuminate\Database\Schema\Blueprint $table) {
        if (!\Schema::hasColumns('table1', ['field4', 'field5'])) {
            $table->string('field4');
            $table->string('field5');
        }
    });

To know more visit Table Migration