SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘id’ in ‘where clause’ (SQL: select * from `flights` where `id` in (pk232))

  laravel
public function delete($airline_id){
   Flight::destroy($airline_id);
   return redirect('flight/read');
  }

  public function update(Request $request,$flight_id){
    return  flight::find($flight_id);
    
    
    return redirect('flight/read');
  }

  public function edit($airline_id){
    $flight_id = Flight::find($airline_id);
    return view('flight/update')->with(['flight'=>$airline_id]);
  }
Route::get('flight/delete/{Flight_id}','[email protected]')->name('flights.delete');

Route::get(‘flight/edit/{airline_id}’,’[email protected]’);
Route::post(‘flight/update/{Flight_id}’,’[email protected]’)->name(‘flight.update’)

Source: Laravel

Leave a Reply