public function yuranTambahan() { $tarikh = explode('-', Request::get('bulan_tahun')); $created_at = $tarikh[1] . '-' . $tarikh[0] . '-' . Carbon::now()->format('d') . ' 00:00:00'; Yurantambahan::create(['jumlah' => Request::get('jumlah'), 'sumbangan_id' => Request::get('sumbangan_id'), 'no_gaji' => Request::get('no_gaji'), 'tarikh' => Request::get('tarikh'), 'penerima' => strtoupper(Request::get('penerima')), 'created_at' => $created_at]); $profile = Profile::where('no_gaji', Request::get('no_gaji'))->first(); $profile->status = 0; $profile->save(); $accounts = AkaunPotongan::where('no_gaji', Request::get('no_gaji'))->get(); if (!$accounts->isEmpty()) { foreach ($accounts as $account) { $account->status = 0; $account->save(); } } Session::flash('success', 'Berjaya. Yuran Tambahan berjaya didaftarkan dan Anggota telah di nyah-aktifkan.'); return redirect()->route('members.yuran.index'); }