update taglel

This commit is contained in:
faiqahzaman
2022-03-21 12:05:49 +08:00
parent 15753afcff
commit d4ab35880f
3 changed files with 25 additions and 9 deletions
+10 -1
View File
@@ -345,11 +345,20 @@ class LelongController extends Controller
public function delete($id)
{
$lelongbid = LelongBid::where('lelong_id', $id)
->get()->toArray();
foreach($lelongbid as $bid)
{
$gadai = Gadai::where('norujukan', $bid['norujukan'])->first();
$gadai->taglel = 0;
$gadai->update();
}
$lelong = Lelong::where('id','=',$id)->first();
// dd($role);
$lelong->delete();
// $gadai = Gadai::
return redirect()->route('lelong.senarailelong')
->with('success','Padam Lelong Berjaya');
}