Alter table Laravel 5 with migration
first of all create new migration using below command
php artisan make:migration Alter_your_comment_yourTableName --table=yourTableName
change the file as per your requirements and after that run the below command in composer
php artisan migrate
Modifying Columns would require doctrine/dbal
package.
Install the Package
composer require doctrine/dbal
Create a migration
php artisan make:migration add_values_to_vote_column_in_votes_table
Update the migration file
Schema::table('votes', function (Blueprint $table) { $table->enum('vote', [' 1', ' 2', ' 3', ' 4', ' 5'])->change(); });
Run the migration
php artisan migrate
Documentation
To do this you should follow these steps:
create a new migration file
php artisan make:migration update_votes_table
open the newly created migration file (app_folder\database\migrations{date_migrationfile_was_created}-update_votes_tables.php)
change the columns you want to change
For more details see the documentation on database migrations
Note: If you add your migrations file to the question we could provide more detailed help
this how i do it:
php artisan make:migration Alter_votes_to_tableName --table=tableName
open the file and change it then
php artisan migrate