It says
'article' already exists ....
If you have no data in your table you can drop it then try to migrate again.
First of all drop table article and just a typo tip it should be 'articles'.
Then got to the migrations table delete the entry that contains the migration name of the article you have made.
After that run php artisan migrate. It will remigrate that table.
thank you but now after "php artisan migrate" show below error and create table:
[Illuminate\Database\QueryException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pic' (SQL: alte
r table `article` add `pic` varchar(255) not null)
[PDOException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pic'
If you want to alter table and add a new field simply delete that field.
sorry for my bad english..
we always create migtations with "Plural" name...it's laravel convention like , if you are creating article migration then run command like
php artisan make:migration create_articles_table. this command will create "articles " table in your database. Now , if you are creating a Model named "Article"..it will automatically creates a table named "articles"..now one thing is to notice here is we have already a article table in our database so model Article will do nothing because articles named table is there..
do like this..this will sure help you because same problem was with me and i overcome that by this way ..
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community