Commit c42cc4a3 by Siti Aisah

fix hapus peserta

parent fae4ccd2
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Kegiatan; use App\Models\Kegiatan;
use App\Models\KegiatanPeserta;
use App\Models\Konferensi; use App\Models\Konferensi;
use App\Models\Registrasi; use App\Models\Registrasi;
use App\Models\User; use App\Models\User;
...@@ -302,7 +303,9 @@ public function index_peserta(){ ...@@ -302,7 +303,9 @@ public function index_peserta(){
public function delete_peserta($id) { public function delete_peserta($id) {
DB::beginTransaction(); DB::beginTransaction();
try{ try{
Registrasi::find($id)->delete(); KegiatanPeserta::where('id_registrasi',$id)->delete();
Registrasi::where('id',$id)->delete();
DB::commit(); DB::commit();
return redirect()->back() return redirect()->back()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment