我試圖在我的數(shù)據(jù)庫(kù)中簡(jiǎn)單地保存一個(gè)簡(jiǎn)單的產(chǎn)品,但由于我不明白的原因,每次嘗試保存時(shí)都會(huì)收到此錯(cuò)誤。SQLSTATE[42S22]:未找到列:1054“字段列表”中的未知列“文件”問(wèn)題是我沒(méi)有任何“文件”列,而且我不想有一個(gè)。這是我的遷移文件: public function up(){ Schema::create('formations', function (Blueprint $table) { $table->id(); $table->string('name')->unique(); $table->string('subtitle'); $table->text('description'); $table->integer('price'); $table->integer('category_id'); $table->integer('level_id'); $table->timestamps(); });}這是我的控制器文件:public function store(Request $request){ $request->validate(([ 'name' => 'required|string', 'price' => 'required', 'description' => 'required', 'subtitle' => 'required', 'category_id' => 'required', 'level_id' => 'required', ])); Formation::create($request->all()); return redirect()->route('admin.formations.index')->with('success','Formation ajoutée');}我很困惑!編輯 :這是 $request 的 dd array:8 [▼ "_token" => "AGHU3QcTxNEd29ZVJ2mNM1lGMwAHDMqbIQEG4XxU" "name" => "Lh lU" "price" => "125" "category_id" => "1" "level_id" => "2" "subtitle" => "Inke hune us kogru wuwuvat kerudowe anuzti gosvili dutoc wiv dufeaba job. Vaamcoj zodli kecuh wu ri hari sisalal gajesma ate ihloef egkes li zu. Ezfaaw uzared c ?" "description" => "<p>gg<br></p>" "files" => null]它說(shuō)“files”=> null,但我不知道該“文件”字段來(lái)自哪里。我的遷移中沒(méi)有任何內(nèi)容,數(shù)據(jù)庫(kù)(PhpMyAdmin)中也沒(méi)有任何內(nèi)容。真是奇怪??!
Laravel:SQLSTATE[42S22]:找不到列:1054“字段列表”中的未知列“文件”
千萬(wàn)里不及你
2023-10-21 17:15:42