skip to Main Content

Laravel Call to a member function delete() on null

in PegawaiController i use join to take nama_departemen from Departemen table public function index() { $data_pegawai = Pegawai::join('departemens','pegawais.id_departemen','=','departemens.id')->paginate(5); return view ('pegawai.index', compact('data_pegawai')); } public function destroy($id) { Pegawai::find($id)->delete(); return redirect()->route('pegawai.index')->with(['success'=> 'Item Berhasil Dihapus']); } in pegawai.index @forelse ($data_pegawai as $item)…

VIEW QUESTION
Back To Top
Search