I was try about CRUD with Eloquent but there is an error when I run my program
Illuminate\Database\QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pegawai.id' in 'where clause' (SQL: select * from
pegawaiwherepegawai.id= 1 limit 1)
I just see my database is no problem but this happen when I want to run my program. And I attach my controller
public function pegawai_edit($id)
{
$pegawai = Pegawai::find($id);
return view('pegawai_edit', ['pegawai' => $pegawai]);
}
and this is my web.php
Route::get('/pegawai/pegawai_edit/{id}', 'PegawaiController@pegawai_edit');
This is my pegawai table :
+------------+--------------+-----------------+--------------+----------------+---------------------+---------------------+
| pegawai_id | pegawai_nama | pegawai_jabatan | pegawai_umur | pegawai_alamat | created_at | updated_at |
+------------+--------------+-----------------+--------------+----------------+---------------------+---------------------+
| 1 | Lucas | NULL | 1 | Jakarta | 2021-09-29 09:07:09 | 2021-09-29 09:07:09 |
| 2 | Test | NULL | 2 | TEST | 2021-09-29 09:07:26 | 2021-09-29 09:07:26 |
+------------+--------------+-----------------+--------------+----------------+---------------------+---------------------+
I'm using laravel 8.6 and mysql is my database
pegawai_idnotid. - ewongpegawai_id- Lucas Futami