コード例 #1
0
ファイル: UsersController.php プロジェクト: GazzD/asoyaracuy
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function delete($id)
 {
     $user = User::find($id);
     $user->house = '[DISABLED-' . date('Y-m-d H:i:s') . ']' . $user->house;
     $user->email = '[DISABLED-' . date('Y-m-d H:i:s') . ']' . $user->email;
     $user->status = 'DISABLED';
     $user->save();
     $payments = Payment::get_payments_from_user($user->id);
     $specialFee = SpecialFee::where('user_id', $id)->where('status', 'ENABLED');
     if ($specialFee != null) {
         $specialFee->user_status = 'DISABLED';
         // $specialFee->save();
     }
     foreach ($payments as $payment) {
         $payment->user_status = 'DISABLED';
         $payment->save();
     }
     return redirect(route('admin.users'));
 }
コード例 #2
0
 public function delete($id)
 {
     $specialFee = SpecialFee::find($id);
     $specialFee->delete();
     return redirect(route('admin'));
 }