diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php index 67f9fbab..8d3a0d23 100644 --- a/app/Http/Controllers/Admin/PaymentController.php +++ b/app/Http/Controllers/Admin/PaymentController.php @@ -190,6 +190,12 @@ class PaymentController extends Controller $ref_user = User::findOrFail($ref_user->referral_id); $increment = number_format($shopProduct->quantity/100*config("SETTINGS::REFERRAL:PERCENTAGE"),0,"",""); $ref_user->increment('credits', $increment); + + //LOGS REFERRALS IN THE ACTIVITY LOG + activity() + ->performedOn($user) + ->causedBy($ref_user) + ->log('gained '. $increment.' '.config("SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME").' for commission-referral of '.$user->name.' (ID:'.$user->id.')'); } } @@ -347,6 +353,12 @@ class PaymentController extends Controller $ref_user = User::findOrFail($ref_user->referral_id); $increment = number_format($shopProduct->quantity/100*config("SETTINGS::REFERRAL:PERCENTAGE"),0,"",""); $ref_user->increment('credits', $increment); + + //LOGS REFERRALS IN THE ACTIVITY LOG + activity() + ->performedOn($user) + ->causedBy($ref_user) + ->log('gained '. $increment.' '.config("SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME").' for commission-referral of '.$user->name.' (ID:'.$user->id.')'); } } @@ -462,6 +474,12 @@ class PaymentController extends Controller $ref_user = User::findOrFail($ref_user->referral_id); $increment = number_format($shopProduct->quantity/100*config("SETTINGS::REFERRAL:PERCENTAGE"),0,"",""); $ref_user->increment('credits', $increment); + + //LOGS REFERRALS IN THE ACTIVITY LOG + activity() + ->performedOn($user) + ->causedBy($ref_user) + ->log('gained '. $increment.' '.config("SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME").' for commission-referral of '.$user->name.' (ID:'.$user->id.')'); } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index ea164fb8..5a805987 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -143,6 +143,12 @@ class RegisterController extends Controller if(config("SETTINGS::REFERRAL:MODE") == "sign-up" || config("SETTINGS::REFERRAL:MODE") == "both") { $ref_user->increment('credits', config("SETTINGS::REFERRAL::REWARD")); $ref_user->notify(new ReferralNotification($ref_user->id, $new_user)); + + //LOGS REFERRALS IN THE ACTIVITY LOG + activity() + ->performedOn($user) + ->causedBy($ref_user) + ->log('gained '. config("SETTINGS::REFERRAL::REWARD").' '.config("SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME").' for sign-up-referral of '.$user->name.' (ID:'.$user->id.')'); } //INSERT INTO USER_REFERRALS TABLE DB::table('user_referrals')->insert([ diff --git a/resources/views/admin/activitylogs/index.blade.php b/resources/views/admin/activitylogs/index.blade.php index 2382a8c3..e0eedc6f 100644 --- a/resources/views/admin/activitylogs/index.blade.php +++ b/resources/views/admin/activitylogs/index.blade.php @@ -77,27 +77,25 @@ @endif