Skip to content
Advertisement

Laravel : SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘files’ in ‘field list’

I’m trying to nake a simple to save a simple Product in my db but for a reason I don’t understand, I get this error each time I try to save.

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘files’ in ‘field list’

The thing is that I don’t have any Files column and I don’t want to have one.

Here’s my migration file :

JavaScript

Here’s my comtroller file :

JavaScript

I’m confused!

Edit :

Here’s the dd of $request

JavaScript

It says “files” => null, but I don’t know where that Files field comes from.

Nothing in my migrations and nothing in the db (PhpMyAdmin).

Really strange!

Advertisement

Answer

There is a files in your request, so you get this error. You can save your query in this way, to prevent extra field :

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