diff --git a/app/Http/Controllers/Admin/OverViewController.php b/app/Http/Controllers/Admin/OverViewController.php
index 1fa022ec..29049b8f 100644
--- a/app/Http/Controllers/Admin/OverViewController.php
+++ b/app/Http/Controllers/Admin/OverViewController.php
@@ -23,7 +23,7 @@ class OverViewController extends Controller
});
$creditCount = Cache::remember('credit:count', self::TTL, function () {
- return User::query()->sum('credits');
+ return User::query()->where("role","!=","admin")->sum('credits');
});
$paymentCount = Cache::remember('payment:count', self::TTL, function () {
diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php
index 72d5e9d2..32bb5c77 100644
--- a/app/Http/Controllers/Admin/PaymentController.php
+++ b/app/Http/Controllers/Admin/PaymentController.php
@@ -164,9 +164,6 @@ class PaymentController extends Controller
$response = $this->getPayPalClient()->execute($request);
if ($response->statusCode == 201 || $response->statusCode == 200) {
- //update credits
- $user->increment('credits', $creditProduct->quantity);
-
//update server limit
if (config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
if ($user->server_limit < config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
@@ -174,6 +171,14 @@ class PaymentController extends Controller
}
}
+ //update User with bought item
+ if ($creditProduct->type=="Credits") {
+ $user->increment('credits', $creditProduct->quantity);
+ }elseif ($creditProduct->type=="Server slots"){
+ $user->increment('server_limit', $creditProduct->quantity);
+ }
+
+
//update role
if ($user->role == 'member') {
$user->update(['role' => 'client']);
@@ -184,7 +189,7 @@ class PaymentController extends Controller
'user_id' => $user->id,
'payment_id' => $response->result->id,
'payment_method' => 'paypal',
- 'type' => 'Credits',
+ 'type' => $creditProduct->type,
'status' => 'paid',
'amount' => $creditProduct->quantity,
'price' => $creditProduct->price,
@@ -305,8 +310,7 @@ class PaymentController extends Controller
// check if payment is 100% completed and payment does not exist in db already
if ($paymentSession->status == "complete" && $paymentIntent->status == "succeeded" && $paymentDbEntry == 0) {
- //update credits
- $user->increment('credits', $creditProduct->quantity);
+
//update server limit
if (config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
@@ -315,6 +319,13 @@ class PaymentController extends Controller
}
}
+ //update User with bought item
+ if ($creditProduct->type=="Credits") {
+ $user->increment('credits', $creditProduct->quantity);
+ }elseif ($creditProduct->type=="Server slots"){
+ $user->increment('server_limit', $creditProduct->quantity);
+ }
+
//update role
if ($user->role == 'member') {
$user->update(['role' => 'client']);
@@ -325,7 +336,7 @@ class PaymentController extends Controller
'user_id' => $user->id,
'payment_id' => $paymentSession->payment_intent,
'payment_method' => 'stripe',
- 'type' => 'Credits',
+ 'type' => $creditProduct->type,
'status' => 'paid',
'amount' => $creditProduct->quantity,
'price' => $creditProduct->price,
@@ -356,7 +367,7 @@ class PaymentController extends Controller
'user_id' => $user->id,
'payment_id' => $paymentSession->payment_intent,
'payment_method' => 'stripe',
- 'type' => 'Credits',
+ 'type' => $creditProduct->type,
'status' => 'processing',
'amount' => $creditProduct->quantity,
'price' => $creditProduct->price,
@@ -405,8 +416,7 @@ class PaymentController extends Controller
$user = User::where('id', $payment->user_id)->first();
if ($paymentIntent->status == 'succeeded' && $payment->status == 'processing') {
- // Increment User Credits
- $user->increment('credits', $payment->amount);
+
//update server limit
if (config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
@@ -414,6 +424,12 @@ class PaymentController extends Controller
$user->update(['server_limit' => config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
}
}
+ //update User with bought item
+ if ($creditProduct->type=="Credits") {
+ $user->increment('credits', $creditProduct->quantity);
+ }elseif ($creditProduct->type=="Server slots"){
+ $user->increment('server_limit', $creditProduct->quantity);
+ }
//update role
if ($user->role == 'member') {
diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php
index c3717653..6b6b3148 100644
--- a/app/Http/Controllers/StoreController.php
+++ b/app/Http/Controllers/StoreController.php
@@ -30,7 +30,7 @@ class StoreController extends Controller
}
return view('store.index')->with([
- 'products' => CreditProduct::where('disabled', '=', false)->orderBy('price', 'asc')->get(),
+ 'products' => CreditProduct::where('disabled', '=', false)->orderBy('type', 'asc')->orderBy('price', 'asc')->get(),
'isPaymentSetup' => $isPaymentSetup,
]);
}
diff --git a/app/Notifications/WelcomeMessage.php b/app/Notifications/WelcomeMessage.php
index a7854478..3841fc83 100644
--- a/app/Notifications/WelcomeMessage.php
+++ b/app/Notifications/WelcomeMessage.php
@@ -42,17 +42,17 @@ class WelcomeMessage extends Notification implements ShouldQueue
$AdditionalLine = "";
if (config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) {
- $AdditionalLine .= "Verifying your e-mail address will grant you " . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') . " additional " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
";
+ $AdditionalLine .= __("Verifying your e-mail address will grant you ") . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL'). " " . __("additional") . " " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
";
}
if (config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) {
- $AdditionalLine .= "Verifying your e-mail will also increase your Server Limit by " . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ".
";
+ $AdditionalLine .= __("Verifying your e-mail will also increase your Server Limit by ") . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ".
";
}
$AdditionalLine .= "
";
if (config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) {
- $AdditionalLine .= "You can also verify your discord account to get another " . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
";
+ $AdditionalLine .= __("You can also verify your discord account to get another ") . config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
";
}
if (config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) {
- $AdditionalLine .= "Verifying your Discord account will also increase your Server Limit by " . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ".
";
+ $AdditionalLine .= __("Verifying your Discord account will also increase your Server Limit by ") . config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ".
";
}
return $AdditionalLine;
@@ -65,19 +65,20 @@ class WelcomeMessage extends Notification implements ShouldQueue
*/
public function toArray($notifiable)
{
+
return [
'title' => __("Getting started!"),
'content' => "
-
Hello {$this->user->name}, Welcome to our dashboard!
-You can verify your e-mail address and link/verify your Discord account.
+".__("Hello")." {$this->user->name}, ".__("Welcome to our dashboard")."!
+".__("You can verify your e-mail address and link/verify your Discord account.")."
" . $this->AdditionalLines() . "
-This dashboard can be used to create and delete servers.
These servers can be used and managed on our pterodactyl panel.
If you have any questions, please join our Discord server and #create-a-ticket.
We hope you can enjoy this hosting experience and if you have any suggestions please let us know!
-Regards,
" . config('app.name', 'Laravel') . "
".__("This dashboard can be used to create and delete servers").".
".__("These servers can be used and managed on our pterodactyl panel").".
".__("If you have any questions, please join our Discord server and #create-a-ticket").".
".__("We hope you can enjoy this hosting experience and if you have any suggestions please let us know")."!
+".__("Regards").",
" . config('app.name', 'Laravel') . "
{{ __('Price') }} | -{{ __('Type') }} | -{{ __('Description') }} | -- |
---|---|---|---|
{{ __('Price') }} | +{{ __('Type') }} | +{{ __('Description') }} | ++ |
{{ $product->formatToCurrency($product->price) }} | -{{ strtolower($product->type) == 'credits' ? CREDITS_DISPLAY_NAME : $product->type }} - | -{{ $product->display }} | -{{ __('Purchase') }} - | -
{{ $product->formatToCurrency($product->price) }} | +{{ strtolower($product->type) == 'credits' ? CREDITS_DISPLAY_NAME : $product->type }} + | ++ @if(strtolower($product->type) == 'credits') + + @elseif (strtolower($product->type) == 'server slots') + + @endif + + {{ $product->display }} | +{{ __('Purchase') }} + | +