Skip to content
Advertisement

Laravel sql table error when i try to upload

This is the error i get

SQLSTATE[HY000]: General error: 1 table posts has no column named caption (SQL: insert into “posts” (“caption”, “image”, “user_id”, “updated_at”, “created_at”) values (Caption,

Why is that

post table code

blade.php code

and i have my PostsController.php as

Why is the error coming up?

Advertisement

Answer

As you are trying to store data into the post table you can do simple like:

Also, you need to import Post model to insert data into post table as below:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement