Compare commits

..

2 commits

Author SHA1 Message Date
IceToast 8a71cdf568 fix: ️ Less DB queries 2023-01-22 15:25:03 +01:00
IceToast 571b035e8b refactor: ♻️ Extract latest ticket to method 2023-01-22 00:01:25 +01:00
91 changed files with 24061 additions and 4466 deletions

View file

@ -1,5 +1,5 @@
### --- App Settings --- ###
APP_NAME=Ctrlpanel.gg
APP_NAME=Controlpanel.gg
APP_ENV=production
APP_KEY=
APP_DEBUG=false

38
.github/ISSUE_TEMPLATE/---bug-report.md vendored Normal file
View file

@ -0,0 +1,38 @@
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: ''
labels: bug
assignees: RamonRobben, AVMG20
---
**Describe the bug 🐛**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View file

@ -0,0 +1,31 @@
---
name: "\U0001F680 Feature request"
about: Suggest a feature or idea for this project
title: "[feature] "
labels: enhancement
assignees: RamonRobben, AVMG20
---
# 🚀 Feature Request
### Is your proposal related to a problem?
*Provide a clear and concise description of what the problem is.
For example, "I can't change x and it makes me have to do manual work"*
(Write your answer here.)
### Describe the solution you'd like
*Provide a clear and concise description of what you want to happen.
For Example, "Automate the changing of x so I don't have to do it manually"*
(Describe your proposed solution here.)
### Additional context
*Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.*
(Write your answer here.)

View file

@ -1,43 +0,0 @@
name: "\U0001F41B Bug report"
description: Create a report to help us improve
title: "[Bug]: "
labels: ["bug"]
body:
- type: textarea
id: what-happened
attributes:
label: What is your request about?
description: |
Provide a clear description of what the problem is.
validations:
required: true
- type: dropdown
id: version
attributes:
label: Branch
description: What branch are you on?
multiple: false
options:
- "main"
- "development"
validations:
required: true
- type: textarea
id: solution
attributes:
label: Solution idea
description: |
Provide a clear description of how you want this bug to be fixed (Optional)
validations:
required: false
- type: textarea
id: ctrlpanel-logs
attributes:
label: Ctrlpanel Logs
description: Please copy and paste your laravel-log output. You may also provide a link to it using the following command `tail -n 100 /var/www/controlpanel/storage/logs/laravel.log | nc pteropaste.com 99`
render: Shell
- type: textarea
id: additional-info
attributes:
label: Additional Info
description: Anything else that could be used to narrow down the issue, like your config.

View file

@ -1,24 +0,0 @@
name: "\U0001F680 Feature request"
description: Suggest a feature or idea for this project
title: "[Feature] "
labels: ["feature"]
body:
- type: textarea
id: feature-description
attributes:
label: Feature Description
description: Provide a clear description of what your idea is all about, what it tries to solve and why it should be implemented.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Solution Idea
description: Provide a clear description how the idea should be implemented and why.
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: Additional Info
description: Anything else that could be used to implement your idea.

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2021 CtrlPanel.gg
Copyright (c) 2021 ControlPanel.gg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -3,7 +3,6 @@
- PayPal Integration
- Stripe Integration
- Referral System
- Partner System
- Ticket System
- Upgrade/Downgrade Server Resources
- Store (credit system with hourly billing and invoices)
@ -13,55 +12,46 @@
- User/Server Management
- Customisable server plans
- Vouchers
- Alert System
- Theme Support
- and so much more!
# CtrlPanel-gg
# ControlPanel-gg
![ctrlpanel](https://user-images.githubusercontent.com/67899387/214684708-739c1d21-06e8-4dec-a4f1-81533a46cc7e.png)
![controlpanel](https://user-images.githubusercontent.com/45005889/123518824-06b05000-d6a8-11eb-91b9-d1ed36bd2317.png)
![](https://img.shields.io/endpoint?label=v0.9%20Installations&url=https%3A%2F%2Fmarket.ctrlpanel.gg%2Fcallhome.php%3Fgetinstalls)
![](https://img.shields.io/badge/Overall%20Installations-5000%2B-green)
![](https://img.shields.io/github/stars/CtrlPanel-gg/panel) ![](https://img.shields.io/github/forks/CtrlPanel-gg/panel) ![](https://img.shields.io/github/tag/CtrlPanel-gg/panel) [![Crowdin](https://badges.crowdin.net/controlpanelgg/localized.svg)](https://crowdin.com/project/controlpanelgg) ![](https://img.shields.io/github/issues/CtrlPanel-gg/panel) ![](https://img.shields.io/github/license/CtrlPanel-gg/panel) ![](https://img.shields.io/discord/787829714483019826)
![](https://img.shields.io/endpoint?label=v0.8%20Installations&url=https%3A%2F%2Fmarket.controlpanel.gg%2Fcallhome.php%3Fgetinstalls)
![](https://img.shields.io/badge/Overall%20Installations-3500%2B-green)
![](https://img.shields.io/github/stars/ControlPanel-gg/dashboard) ![](https://img.shields.io/github/forks/ControlPanel-gg/dashboard) ![](https://img.shields.io/github/tag/ControlPanel-gg/dashboard) [![Crowdin](https://badges.crowdin.net/controlpanelgg/localized.svg)](https://crowdin.com/project/controlpanelgg) ![](https://img.shields.io/github/issues/ControlPanel-gg/dashboard) ![](https://img.shields.io/github/license/ControlPanel-gg/dashboard) ![](https://img.shields.io/discord/787829714483019826)
## About
CtrlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their pterodactyl servers. This dashboard comes with a credit-based billing solution that credits users hourly for each server they have and suspends them if they run out of credits.
ControlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their pterodactyl servers. This dashboard comes with a credit-based billing solution that credits users hourly for each server they have and suspends them if they run out of credits.
This dashboard offers an easy to use and free billing solution for all starting and experienced hosting providers. This dashboard has many customisation options and added discord Oauth verification to offer a solid link between your discord server and your dashboard. You can check our [Demo here](https://demo.ctrlpanel.gg "Demo").
This dashboard offers an easy to use and free billing solution for all starting and experienced hosting providers. This dashboard has many customization options and added discord 0auth verification to offer a solid link between your discord server and your dashboard. You can check our Demo here ([Demo](https://demo.controlpanel.gg "Demo"))
### [Installation](https://ctrlpanel.gg/docs/intro "Installation")
### [Installation](https://controlpanel.gg/docs/intro "Installation")
### [Updating](https://ctrlpanel.gg/docs/Installation/updating "Updating")
### [Updating](https://controlpanel.gg/docs/Installation/updating "Updating")
### [Discord](https://discord.gg/4Y6HjD2uyU "Discord")
### [Discord](https://discord.gg/4Y6HjD2uyU "discord")
### [Contributing](https://ctrlpanel.gg/docs/Contributing/contributing "Contributing")
### [Contributing](https://controlpanel.gg/docs/Contributing/contributing "Contributing")
### [Donating](https://ctrlpanel.gg/docs/Contributing/donating "Donating")
### [Donating](https://controlpanel.gg/docs/Contributing/donating "Donating")
# Preview
### Server Creation
![image](https://user-images.githubusercontent.com/67899387/214687234-d1ae58c0-5667-4e99-ac39-adeaabfcc7f2.png)
![image](https://user-images.githubusercontent.com/8725848/171575021-bc248f12-2aba-44e8-82aa-bdc907b1d3fc.png)
### Overview
![image](https://user-images.githubusercontent.com/67899387/214685859-03c8d9e1-c685-4a07-979f-df2e88ec3931.png)
![image](https://user-images.githubusercontent.com/8725848/171575809-7620ed4f-5715-420f-8c25-8bfa1c4342f7.png)
### Example server products
![image](https://user-images.githubusercontent.com/67899387/214686950-218e1ede-6a1f-4e53-b3f4-fe1abc371a9c.png)
![image](https://user-images.githubusercontent.com/8725848/171575987-c1398ff6-83fa-4cb8-bd1f-986cee4da565.png)
### Ticket System
![image](https://user-images.githubusercontent.com/67899387/214687123-0a3d0f8f-b53c-4b0d-869a-4d5df45f5184.png)
### Voucher System
![image](https://user-images.githubusercontent.com/67899387/214686578-ec9f0b0f-6047-4665-835f-70594b56dfd5.png)
### Partner System
![image](https://user-images.githubusercontent.com/67899387/214686321-36ba97a3-4181-4e60-9ba3-c9b318fe66a8.png)
![image](https://user-images.githubusercontent.com/8725848/184131270-9d997ebf-8965-4910-90d2-b410ae37f201.png)

View file

@ -50,7 +50,6 @@ class System
'pterodactyl-admin-api-key' => 'required|string',
'enable-upgrades' => 'string',
'enable-disable-servers' => 'string',
'enable-disable-new-users' => 'string',
'show-imprint' => 'string',
'show-privacy' => 'string',
'show-tos' => 'string',

View file

@ -67,7 +67,7 @@ class ChargeCreditsCommand extends Command
$server->suspend();
//add user to notify list
if (!in_array($user, $this->usersToNotify)) {
if (! in_array($user, $this->usersToNotify)) {
array_push($this->usersToNotify, $user);
}
} catch (\Exception $exception) {
@ -85,7 +85,7 @@ class ChargeCreditsCommand extends Command
*/
public function notifyUsers()
{
if (!empty($this->usersToNotify)) {
if (! empty($this->usersToNotify)) {
/** @var User $user */
foreach ($this->usersToNotify as $user) {
$this->line("<fg=yellow>Notified user:</> <fg=blue>{$user->name}</>");

View file

@ -1,42 +0,0 @@
<?php
namespace App\Console\Commands;
use App\Models\Payment;
use Illuminate\Console\Command;
class CleanupOpenPayments extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'payments:open:clear';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Clears all payments from the database that have state "open"';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
// delete all payments that have state "open" and are older than 1 hour
try {
Payment::where('status', 'open')->where('updated_at', '<', now()->subHour())->delete();
} catch (\Exception $e) {
$this->error('Could not delete payments: ' . $e->getMessage());
return 1;
}
$this->info('Successfully deleted all open payments');
return Command::SUCCESS;
}
}

View file

@ -32,7 +32,7 @@ class GetGithubVersion extends Command
public function handle()
{
try{
$latestVersion = Http::get('https://api.github.com/repos/ctrlpanel-gg/panel/tags')->json()[0]['name'];
$latestVersion = Http::get('https://api.github.com/repos/controlpanel-gg/dashboard/tags')->json()[0]['name'];
Storage::disk('local')->put('latestVersion', $latestVersion);
} catch (Exception $e) {
Storage::disk('local')->put('latestVersion', "unknown");

View file

@ -4,16 +4,12 @@ namespace App\Console\Commands;
use App\Classes\Pterodactyl;
use App\Models\User;
use App\Traits\Referral;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
class MakeUserCommand extends Command
{
use Referral;
/**
* The name and signature of the console command.
*
@ -41,7 +37,6 @@ class MakeUserCommand extends Command
$this->pterodactyl = $pterodactyl;
}
/**
* Execute the console command.
*
@ -83,12 +78,12 @@ class MakeUserCommand extends Command
return 0;
}
$user = User::create([
'name' => $response['first_name'],
'email' => $response['email'],
'role' => 'admin',
'password' => Hash::make($password),
'referral_code' => $this->createReferralCode(),
'pterodactyl_id' => $response['id'],
]);
@ -98,7 +93,6 @@ class MakeUserCommand extends Command
['Username', $user->name],
['Ptero-ID', $user->pterodactyl_id],
['Admin', $user->role],
['Referral code', $user->referral_code],
]);
return 1;

View file

@ -18,11 +18,10 @@ class Kernel extends ConsoleKernel
{
$schedule->command('credits:charge')->hourly();
$schedule->command('cp:versioncheck:get')->daily();
$schedule->command('payments:open:clear')->daily();
//log cronjob activity
$schedule->call(function () {
Storage::disk('logs')->put('cron.log', 'Last activity from cronjobs - ' . now());
Storage::disk('logs')->put('cron.log', 'Last activity from cronjobs - '.now());
})->everyMinute();
}
@ -33,7 +32,7 @@ class Kernel extends ConsoleKernel
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}

View file

@ -1,19 +0,0 @@
<?php
namespace App\Enums;
enum UsefulLinkLocation:String
{
/**
* Top bar
* Only visible in the dashboard view
*/
case topbar = "topbar";
/**
* Dashboard
* Only visible in the dashboard view
*/
case dashboard = "dashboard";
}

View file

@ -8,6 +8,5 @@ function getConfig()
"name" => "PayPal",
"description" => "PayPal payment gateway",
"RoutesIgnoreCsrf" => [],
"enabled" => (config('SETTINGS::PAYMENTS:PAYPAL:SECRET') && config('SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID')) || (config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET') && config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_CLIENT_ID') && env("APP_ENV") === "local"),
];
}

View file

@ -9,7 +9,6 @@ use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Log;
use PayPalCheckoutSdk\Core\PayPalHttpClient;
use PayPalCheckoutSdk\Core\ProductionEnvironment;
use PayPalCheckoutSdk\Core\SandboxEnvironment;
@ -75,7 +74,7 @@ function PaypalPay(Request $request)
"application_context" => [
"cancel_url" => route('payment.Cancel'),
"return_url" => route('payment.PayPalSuccess', ['payment' => $payment->id]),
'brand_name' => config('app.name', 'CtrlPanel.gg'),
'brand_name' => config('app.name', 'Laravel'),
'shipping_preference' => 'NO_SHIPPING'
]
@ -86,23 +85,14 @@ function PaypalPay(Request $request)
// Call API with your client and get a response for your call
$response = getPayPalClient()->execute($request);
// check for any errors in the response
if ($response->statusCode != 201) {
throw new \Exception($response->statusCode);
}
// make sure the link is not empty
if (empty($response->result->links[1]->href)) {
throw new \Exception('No redirect link found');
}
Redirect::away($response->result->links[1]->href)->send();
return;
} catch (HttpException $ex) {
Log::error('PayPal Payment: ' . $ex->getMessage());
$payment->delete();
error_log($ex->statusCode);
error_log($ex->getMessage());
Redirect::route('store.index')->with('error', __('Payment failed'))->send();
$payment->delete();
Redirect::route('payment.Cancel');
return;
}
}

View file

@ -10,6 +10,5 @@ function getConfig()
"RoutesIgnoreCsrf" => [
"payment/StripeWebhooks",
],
"enabled" => config('SETTINGS::PAYMENTS:STRIPE:SECRET') && config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_SECRET') || config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_TEST_SECRET') && config('SETTINGS::PAYMENTS:STRIPE:TEST_SECRET') && env("APP_ENV") === "local",
];
}

View file

@ -51,11 +51,13 @@ class ExtensionHelper
$routes = array_merge($routes, $config['RoutesIgnoreCsrf']);
}
// map over the routes and add the extension name as prefix
$result = array_map(fn ($item) => "extensions/{$item}", $routes);
// add extension/ infront of every route
foreach ($routes as $key => $route) {
$routes[$key] = 'extensions/' . $route;
}
}
return $result;
return $routes;
}
/**

View file

@ -1,42 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
use Qirolab\Theme\Theme;
class LegalController extends Controller
{
/**
* Display
*
* @return View
*/
public function index()
{
$tos = File::get(Theme::path($path = 'views', "default") . '/information/tos-content.blade.php');
$privacy = File::get(Theme::path($path = 'views', "default") . '/information/privacy-content.blade.php');
$imprint = File::get(Theme::path($path = 'views', "default") . '/information/imprint-content.blade.php');
return view('admin.legal.index')->with([
"tos" => $tos,
"privacy" => $privacy,
"imprint" => $imprint,
]);
}
public function update(Request $request){
$tos = $request->tos;
$privacy = $request->privacy;
$imprint = $request->imprint;
File::put(Theme::path($path = 'views', "default") . '/information/tos-content.blade.php', $tos);
File::put(Theme::path($path = 'views', "default") . '/information/privacy-content.blade.php', $privacy);
File::put(Theme::path($path = 'views', "default") . '/information/imprint-content.blade.php', $imprint);
return back()->with("success",__("Legal pages updated"));
}
}

View file

@ -60,7 +60,7 @@ class OverViewController extends Controller
//Fill out variables for each currency separately
foreach ($payments->where('created_at', '>=', Carbon::today()->startOfMonth()) as $payment) {
$paymentCurrency = $payment->currency_code;
if (! isset($counters['payments']['thisMonth'][$paymentCurrency])) {
if (!isset($counters['payments']['thisMonth'][$paymentCurrency])) {
$counters['payments']['thisMonth']->put($paymentCurrency, collect());
$counters['payments']['thisMonth'][$paymentCurrency]->total = 0;
$counters['payments']['thisMonth'][$paymentCurrency]->count = 0;
@ -70,7 +70,7 @@ class OverViewController extends Controller
}
foreach ($payments->where('created_at', '<', Carbon::today()->startOfMonth()) as $payment) {
$paymentCurrency = $payment->currency_code;
if (! isset($counters['payments']['lastMonth'][$paymentCurrency])) {
if (!isset($counters['payments']['lastMonth'][$paymentCurrency])) {
$counters['payments']['lastMonth']->put($paymentCurrency, collect());
$counters['payments']['lastMonth'][$paymentCurrency]->total = 0;
$counters['payments']['lastMonth'][$paymentCurrency]->count = 0;
@ -89,9 +89,9 @@ class OverViewController extends Controller
$counters['payments']->total = Payment::query()->count();
foreach($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()) as $taxPayment){
foreach ($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()) as $taxPayment) {
$paymentCurrency = $taxPayment->currency_code;
if(!isset($counters['taxPayments']['thisYear'][$paymentCurrency])){
if (!isset($counters['taxPayments']['thisYear'][$paymentCurrency])) {
$counters['taxPayments']['thisYear']->put($paymentCurrency, collect());
$counters['taxPayments']['thisYear'][$paymentCurrency]->total = 0;
@ -105,9 +105,9 @@ class OverViewController extends Controller
$counters['taxPayments']['thisYear'][$paymentCurrency]->taxes += $taxPayment->tax_value;
}
foreach($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()->subYear())->where('created_at', '<', Carbon::today()->startOfYear()) as $taxPayment){
foreach ($taxPayments->where('created_at', '>=', Carbon::today()->startOfYear()->subYear())->where('created_at', '<', Carbon::today()->startOfYear()) as $taxPayment) {
$paymentCurrency = $taxPayment->currency_code;
if(!isset($counters['taxPayments']['lastYear'][$paymentCurrency])){
if (!isset($counters['taxPayments']['lastYear'][$paymentCurrency])) {
$counters['taxPayments']['lastYear']->put($paymentCurrency, collect());
$counters['taxPayments']['lastYear'][$paymentCurrency]->total = 0;
@ -138,11 +138,16 @@ class OverViewController extends Controller
array_push($pteroNodeIds, $pteroNode['attributes']['id']);
}
$nodes = collect();
foreach ($DBnodes = Node::query()->get() as $DBnode) { //gets all node information and prepares the structure
//gets all node information and prepares the structure
foreach ($DBnodes = Node::query()->get() as $DBnode) {
$nodeId = $DBnode['id'];
if (! in_array($nodeId, $pteroNodeIds)) {
//Check if node exists on pterodactyl too, if not, skip
if (!in_array($nodeId, $pteroNodeIds)) {
continue;
} //Check if node exists on pterodactyl too, if not, skip
}
$nodes->put($nodeId, collect());
$nodes[$nodeId]->name = $DBnode['name'];
$pteroNode = Pterodactyl::getNode($nodeId);
@ -156,12 +161,12 @@ class OverViewController extends Controller
}
$counters['totalUsagePercent'] = ($DBnodes->count()) ? round($counters['totalUsagePercent'] / $DBnodes->count(), 2) : 0;
foreach (Pterodactyl::getServers() as $server) { //gets all servers from Pterodactyl and calculates total of credit usage for each node separately + total
// Calculate server and earnings information
foreach (Pterodactyl::getServers() as $server) {
$nodeId = $server['attributes']['node'];
if ($CPServer = Server::query()->where('pterodactyl_id', $server['attributes']['id'])->first()) {
$price = Product::query()->where('id', $CPServer->product_id)->first()->price;
if (! $CPServer->suspended) {
if ($CPServer = Server::query()->where('pterodactyl_id', $server['attributes']['id'])->with('product')->first()) {
$price = $CPServer->product->price;
if (!$CPServer->suspended) {
$counters['earnings']->active += $price;
$counters['servers']->active++;
$nodes[$nodeId]->activeEarnings += $price;
@ -174,31 +179,7 @@ class OverViewController extends Controller
}
}
//Get latest tickets
$tickets = collect();
foreach (Ticket::query()->latest()->take(5)->get() as $ticket) {
$tickets->put($ticket->ticket_id, collect());
$tickets[$ticket->ticket_id]->title = $ticket->title;
$user = User::query()->where('id', $ticket->user_id)->first();
$tickets[$ticket->ticket_id]->user_id = $user->id;
$tickets[$ticket->ticket_id]->user = $user->name;
$tickets[$ticket->ticket_id]->status = $ticket->status;
$tickets[$ticket->ticket_id]->last_updated = $ticket->updated_at->diffForHumans();
switch ($ticket->status) {
case 'Open':
$tickets[$ticket->ticket_id]->statusBadgeColor = 'badge-success';
break;
case 'Closed':
$tickets[$ticket->ticket_id]->statusBadgeColor = 'badge-danger';
break;
case 'Answered':
$tickets[$ticket->ticket_id]->statusBadgeColor = 'badge-info';
break;
default:
$tickets[$ticket->ticket_id]->statusBadgeColor = 'badge-warning';
break;
}
}
$tickets = $this->getLatestTickets();
return view('admin.overview.index', [
'counters' => $counters,
@ -220,4 +201,29 @@ class OverViewController extends Controller
return redirect()->back()->with('success', __('Pterodactyl synced'));
}
private function getLatestTickets()
{
$tickets = Ticket::query()->with('user')->orderBy('updated_at', 'desc')->limit(5)->get();
foreach ($tickets as $ticket) {
$ticket->user = $ticket->user->name;
$ticket->last_updated = $ticket->updated_at->diffForHumans();
switch ($ticket->status) {
case 'Open':
$ticket->statusBadgeColor = 'badge-success';
break;
case 'Closed':
$ticket->statusBadgeColor = 'badge-danger';
break;
case 'Answered':
$ticket->statusBadgeColor = 'badge-info';
break;
default:
$ticket->statusBadgeColor = 'badge-warning';
break;
}
}
return $tickets;
}
}

View file

@ -2,7 +2,6 @@
namespace App\Http\Controllers\Admin;
use App\Events\PaymentEvent;
use App\Events\UserUpdateCreditsEvent;
use App\Http\Controllers\Controller;
use App\Models\PartnerDiscount;
@ -39,29 +38,19 @@ class PaymentController extends Controller
*/
public function checkOut(ShopProduct $shopProduct)
{
$discount = PartnerDiscount::getDiscount();
$price = $shopProduct->price - ($shopProduct->price * $discount / 100);
$extensions = ExtensionHelper::getAllExtensionsByNamespace('PaymentGateways');
// build a paymentgateways array that contains the routes for the payment gateways and the image path for the payment gateway which lays in public/images/Extensions/PaymentGateways with the extensionname in lowercase
$paymentGateways = [];
if ($price > 0) {
$extensions = ExtensionHelper::getAllExtensionsByNamespace('PaymentGateways');
// build a paymentgateways array that contains the routes for the payment gateways and the image path for the payment gateway which lays in public/images/Extensions/PaymentGateways with the extensionname in lowercase
foreach ($extensions as $extension) {
$extensionName = basename($extension);
if (!ExtensionHelper::getExtensionConfig($extensionName, 'enabled')) continue; // skip if not enabled
$payment = new \stdClass();
$payment->name = ExtensionHelper::getExtensionConfig($extensionName, 'name');
$payment->image = asset('images/Extensions/PaymentGateways/' . strtolower($extensionName) . '_logo.png');
$paymentGateways[] = $payment;
}
foreach ($extensions as $extension) {
$extensionName = basename($extension);
$payment = new \stdClass();
$payment->name = ExtensionHelper::getExtensionConfig($extensionName, 'name');
$payment->image = asset('images/Extensions/PaymentGateways/' . strtolower($extensionName) . '_logo.png');
$paymentGateways[] = $payment;
}
$discount = PartnerDiscount::getDiscount();
return view('store.checkout')->with([
'product' => $shopProduct,
@ -72,7 +61,6 @@ class PaymentController extends Controller
'taxpercent' => $shopProduct->getTaxPercent(),
'total' => $shopProduct->getTotalPrice(),
'paymentGateways' => $paymentGateways,
'productIsFree' => $price <= 0,
]);
}
@ -81,12 +69,29 @@ class PaymentController extends Controller
* @param ShopProduct $shopProduct
* @return RedirectResponse
*/
public function handleFreeProduct(ShopProduct $shopProduct)
public function FreePay(ShopProduct $shopProduct)
{
//check if the product is really free or the discount is 100%
if ($shopProduct->getTotalPrice() > 0) return redirect()->route('home')->with('error', __('An error ocured. Please try again.'));
//give product
/** @var User $user */
$user = Auth::user();
//create a payment
//not updating server limit
//update User with bought item
if ($shopProduct->type == "Credits") {
$user->increment('credits', $shopProduct->quantity);
} elseif ($shopProduct->type == "Server slots") {
$user->increment('server_limit', $shopProduct->quantity);
}
//skipped the referral commission, because the user did not pay anything.
//not giving client role
//store payment
$payment = Payment::create([
'user_id' => $user->id,
'payment_id' => uniqid(),
@ -103,7 +108,6 @@ class PaymentController extends Controller
]);
event(new UserUpdateCreditsEvent($user));
event(new PaymentEvent($user, $payment, $shopProduct));
//not sending an invoice
@ -116,12 +120,6 @@ class PaymentController extends Controller
$product = ShopProduct::find($request->product_id);
$paymentGateway = $request->payment_method;
// on free products, we don't need to use a payment gateway
$realPrice = $product->price - ($product->price * PartnerDiscount::getDiscount() / 100);
if ($realPrice <= 0) {
return $this->handleFreeProduct($product);
}
return redirect()->route('payment.' . $paymentGateway . 'Pay', ['shopProduct' => $product->id]);
}

View file

@ -14,7 +14,6 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Log;
class ServerController extends Controller
{
@ -28,6 +27,38 @@ class ServerController extends Controller
return view('admin.servers.index');
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param Server $server
* @return Response
*/
public function show(Server $server)
{
//
}
/**
* Show the form for editing the specified resource.
*
@ -165,8 +196,6 @@ class ServerController extends Controller
public function dataTable(Request $request)
{
$query = Server::with(['user', 'product']);
if ($request->has('product')) {
$query->where('product_id', '=', $request->input('product'));
}
@ -175,9 +204,6 @@ class ServerController extends Controller
}
$query->select('servers.*');
Log::info($request->input('order'));
return datatables($query)
->addColumn('user', function (Server $server) {
return '<a href="' . route('admin.users.show', $server->user->id) . '">' . $server->user->name . '</a>';
@ -206,7 +232,7 @@ class ServerController extends Controller
';
})
->addColumn('status', function (Server $server) {
$labelColor = $server->suspended ? 'text-danger' : 'text-success';
$labelColor = $server->isSuspended() ? 'text-danger' : 'text-success';
return '<i class="fas ' . $labelColor . ' fa-circle mr-2"></i>';
})

View file

@ -22,13 +22,7 @@ class SettingsController extends Controller
//Get all tabs as laravel view paths
$tabs = [];
if(file_exists(Theme::getViewPaths()[0] . '/admin/settings/tabs/')){
$tabspath = glob(Theme::getViewPaths()[0] . '/admin/settings/tabs/*.blade.php');
}else{
$tabspath = glob(Theme::path($path = 'views', $themeName = 'default').'/admin/settings/tabs/*.blade.php');
}
foreach ($tabspath as $filename) {
foreach (glob(Theme::getViewPaths()[0] . '/admin/settings/tabs/*.blade.php') as $filename) {
$tabs[] = 'admin.settings.tabs.'.basename($filename, '.blade.php');
}

View file

@ -14,7 +14,6 @@ use Illuminate\Validation\Rule;
class ShopProductController extends Controller
{
/**
* Display a listing of the resource.
*
@ -67,12 +66,23 @@ class ShopProductController extends Controller
'display' => 'required|string|max:60',
]);
$disabled = !is_null($request->input('disabled'));
$disabled = ! is_null($request->input('disabled'));
ShopProduct::create(array_merge($request->all(), ['disabled' => $disabled]));
return redirect()->route('admin.store.index')->with('success', __('Store item has been created!'));
}
/**
* Display the specified resource.
*
* @param ShopProduct $shopProduct
* @return Response
*/
public function show(ShopProduct $shopProduct)
{
//
}
/**
* Show the form for editing the specified resource.
*
@ -106,7 +116,7 @@ class ShopProductController extends Controller
'display' => 'required|string|max:60',
]);
$disabled = !is_null($request->input('disabled'));
$disabled = ! is_null($request->input('disabled'));
$shopProduct->update(array_merge($request->all(), ['disabled' => $disabled]));
return redirect()->route('admin.store.index')->with('success', __('Store item has been updated!'));
@ -119,7 +129,7 @@ class ShopProductController extends Controller
*/
public function disable(Request $request, ShopProduct $shopProduct)
{
$shopProduct->update(['disabled' => !$shopProduct->disabled]);
$shopProduct->update(['disabled' => ! $shopProduct->disabled]);
return redirect()->route('admin.store.index')->with('success', __('Product has been updated!'));
}
@ -137,20 +147,19 @@ class ShopProductController extends Controller
return redirect()->back()->with('success', __('Store item has been removed!'));
}
public function dataTable(Request $request)
public function dataTable()
{
$query = ShopProduct::query();
return datatables($query)
->addColumn('actions', function (ShopProduct $shopProduct) {
return '
<a data-content="' . __('Edit') . '" data-toggle="popover" data-trigger="hover" data-placement="top" href="' . route('admin.store.edit', $shopProduct->id) . '" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></a>
<a data-content="'.__('Edit').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.store.edit', $shopProduct->id).'" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></a>
<form class="d-inline" onsubmit="return submitResult();" method="post" action="' . route('admin.store.destroy', $shopProduct->id) . '">
' . csrf_field() . '
' . method_field('DELETE') . '
<button data-content="' . __('Delete') . '" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
<form class="d-inline" onsubmit="return submitResult();" method="post" action="'.route('admin.store.destroy', $shopProduct->id).'">
'.csrf_field().'
'.method_field('DELETE').'
<button data-content="'.__('Delete').'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
</form>
';
})
@ -158,12 +167,12 @@ class ShopProductController extends Controller
$checked = $shopProduct->disabled == false ? 'checked' : '';
return '
<form class="d-inline" onsubmit="return submitResult();" method="post" action="' . route('admin.store.disable', $shopProduct->id) . '">
' . csrf_field() . '
' . method_field('PATCH') . '
<form class="d-inline" onsubmit="return submitResult();" method="post" action="'.route('admin.store.disable', $shopProduct->id).'">
'.csrf_field().'
'.method_field('PATCH').'
<div class="custom-control custom-switch">
<input ' . $checked . ' name="disabled" onchange="this.form.submit()" type="checkbox" class="custom-control-input" id="switch' . $shopProduct->id . '">
<label class="custom-control-label" for="switch' . $shopProduct->id . '"></label>
<input '.$checked.' name="disabled" onchange="this.form.submit()" type="checkbox" class="custom-control-input" id="switch'.$shopProduct->id.'">
<label class="custom-control-label" for="switch'.$shopProduct->id.'"></label>
</div>
</form>
';

View file

@ -2,7 +2,6 @@
namespace App\Http\Controllers\Admin;
use App\Enums\UsefulLinkLocation;
use App\Http\Controllers\Controller;
use App\Models\UsefulLink;
use Illuminate\Contracts\Foundation\Application;
@ -31,8 +30,7 @@ class UsefulLinkController extends Controller
*/
public function create()
{
$positions = UsefulLinkLocation::cases();
return view('admin.usefullinks.create')->with('positions', $positions);
return view('admin.usefullinks.create');
}
/**
@ -50,14 +48,7 @@ class UsefulLinkController extends Controller
'description' => 'required|string|max:2000',
]);
UsefulLink::create([
'icon' => $request->icon,
'title' => $request->title,
'link' => $request->link,
'description' => $request->description,
'position' => implode(",",$request->position),
]);
UsefulLink::create($request->all());
return redirect()->route('admin.usefullinks.index')->with('success', __('link has been created!'));
}
@ -81,10 +72,8 @@ class UsefulLinkController extends Controller
*/
public function edit(UsefulLink $usefullink)
{
$positions = UsefulLinkLocation::cases();
return view('admin.usefullinks.edit', [
'link' => $usefullink,
'positions' => $positions,
]);
}
@ -104,13 +93,7 @@ class UsefulLinkController extends Controller
'description' => 'required|string|max:2000',
]);
$usefullink->update([
'icon' => $request->icon,
'title' => $request->title,
'link' => $request->link,
'description' => $request->description,
'position' => implode(",",$request->position),
]);
$usefullink->update($request->all());
return redirect()->route('admin.usefullinks.index')->with('success', __('link has been updated!'));
}

View file

@ -26,7 +26,6 @@ use Spatie\QueryBuilder\QueryBuilder;
class UserController extends Controller
{
private Pterodactyl $pterodactyl;
public function __construct(Pterodactyl $pterodactyl)
@ -133,7 +132,7 @@ class UserController extends Controller
]);
}
if (!is_null($request->input('new_password'))) {
if (! is_null($request->input('new_password'))) {
$request->validate([
'new_password' => 'required|string|min:8',
'new_password_confirmation' => 'required|same:new_password',
@ -260,7 +259,7 @@ class UserController extends Controller
public function toggleSuspended(User $user)
{
try {
!$user->isSuspended() ? $user->suspend() : $user->unSuspend();
! $user->isSuspended() ? $user->suspend() : $user->unSuspend();
} catch (Exception $exception) {
return redirect()->back()->with('error', $exception->getMessage());
}
@ -271,45 +270,52 @@ class UserController extends Controller
/**
* @throws Exception
*/
public function dataTable(Request $request)
public function dataTable()
{
$query = User::with('discordUser')->withCount('servers');
// manually count referrals in user_referrals table
$query->selectRaw('users.*, (SELECT COUNT(*) FROM user_referrals WHERE user_referrals.referral_id = users.id) as referrals_count');
$query = User::with(['discordUser', 'servers'])->select('users.*');
return datatables($query)
->addColumn('avatar', function (User $user) {
return '<img width="28px" height="28px" class="rounded-circle ml-1" src="' . $user->getAvatar() . '">';
return '<img width="28px" height="28px" class="rounded-circle ml-1" src="'.$user->getAvatar().'">';
})
->addColumn('credits', function (User $user) {
return '<i class="fas fa-coins mr-2"></i> ' . $user->credits();
return '<i class="fas fa-coins mr-2"></i> '.$user->credits();
})
->addColumn('verified', function (User $user) {
return $user->getVerifiedStatus();
})
->addColumn('servers', function (User $user) {
return $user->servers->count();
})
->addColumn('referrals', function (User $user) {
return DB::table('user_referrals')->where('referral_id', '=', $user->id)->count();
})
->addColumn('discordId', function (User $user) {
return $user->discordUser ? $user->discordUser->id : '';
})
->addColumn('last_seen', function (User $user) {
return ['display' => $user->last_seen ? $user->last_seen->diffForHumans() : '',
'raw' => $user->last_seen ? strtotime($user->last_seen) : '', ];
})
->addColumn('actions', function (User $user) {
$suspendColor = $user->isSuspended() ? 'btn-success' : 'btn-warning';
$suspendIcon = $user->isSuspended() ? 'fa-play-circle' : 'fa-pause-circle';
$suspendText = $user->isSuspended() ? __('Unsuspend') : __('Suspend');
return '
<a data-content="' . __('Login as User') . '" data-toggle="popover" data-trigger="hover" data-placement="top" href="' . route('admin.users.loginas', $user->id) . '" class="btn btn-sm btn-primary mr-1"><i class="fas fa-sign-in-alt"></i></a>
<a data-content="' . __('Verify') . '" data-toggle="popover" data-trigger="hover" data-placement="top" href="' . route('admin.users.verifyEmail', $user->id) . '" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-envelope"></i></a>
<a data-content="' . __('Show') . '" data-toggle="popover" data-trigger="hover" data-placement="top" href="' . route('admin.users.show', $user->id) . '" class="btn btn-sm text-white btn-warning mr-1"><i class="fas fa-eye"></i></a>
<a data-content="' . __('Edit') . '" data-toggle="popover" data-trigger="hover" data-placement="top" href="' . route('admin.users.edit', $user->id) . '" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></a>
<form class="d-inline" method="post" action="' . route('admin.users.togglesuspend', $user->id) . '">
' . csrf_field() . '
<button data-content="' . $suspendText . '" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm ' . $suspendColor . ' text-white mr-1"><i class="far ' . $suspendIcon . '"></i></button>
</form>
<form class="d-inline" onsubmit="return submitResult();" method="post" action="' . route('admin.users.destroy', $user->id) . '">
' . csrf_field() . '
' . method_field('DELETE') . '
<button data-content="' . __('Delete') . '" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
</form>
<a data-content="'.__('Login as User').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.users.loginas', $user->id).'" class="btn btn-sm btn-primary mr-1"><i class="fas fa-sign-in-alt"></i></a>
<a data-content="'.__('Verify').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.users.verifyEmail', $user->id).'" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-envelope"></i></a>
<a data-content="'.__('Show').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.users.show', $user->id).'" class="btn btn-sm text-white btn-warning mr-1"><i class="fas fa-eye"></i></a>
<a data-content="'.__('Edit').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('admin.users.edit', $user->id).'" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></a>
<form class="d-inline" method="post" action="'.route('admin.users.togglesuspend', $user->id).'">
'.csrf_field().'
<button data-content="'.$suspendText.'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm '.$suspendColor.' text-white mr-1"><i class="far '.$suspendIcon.'"></i></button>
</form>
<form class="d-inline" onsubmit="return submitResult();" method="post" action="'.route('admin.users.destroy', $user->id).'">
'.csrf_field().'
'.method_field('DELETE').'
<button data-content="'.__('Delete').'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
</form>
';
})
->editColumn('role', function (User $user) {
@ -328,15 +334,15 @@ class UserController extends Controller
break;
}
return '<span class="badge ' . $badgeColor . '">' . $user->role . '</span>';
})
->editColumn('last_seen', function (User $user) {
return $user->last_seen ? $user->last_seen->diffForHumans() : __('Never');
return '<span class="badge '.$badgeColor.'">'.$user->role.'</span>';
})
->editColumn('name', function (User $user) {
return '<a class="text-info" target="_blank" href="' . config('SETTINGS::SYSTEM:PTERODACTYL:URL') . '/admin/users/view/' . $user->pterodactyl_id . '">' . strip_tags($user->name) . '</a>';
return '<a class="text-info" target="_blank" href="'.config('SETTINGS::SYSTEM:PTERODACTYL:URL').'/admin/users/view/'.$user->pterodactyl_id.'">'.strip_tags($user->name).'</a>';
})
->rawColumns(['avatar', 'name', 'credits', 'role', 'usage', 'actions'])
->make();
/*->orderColumn('last_seen', function ($query) {
$query->orderBy('last_seen', "desc");
})*/
->rawColumns(['avatar', 'name', 'credits', 'role', 'usage', 'referrals', 'actions', 'last_seen'])
->make(true);
}
}

View file

@ -8,7 +8,6 @@ use App\Http\Controllers\Controller;
use App\Models\DiscordUser;
use App\Models\User;
use App\Notifications\ReferralNotification;
use App\Traits\Referral;
use Carbon\Carbon;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
@ -28,8 +27,6 @@ use Spatie\QueryBuilder\QueryBuilder;
class UserController extends Controller
{
use Referral;
const ALLOWED_INCLUDES = ['servers', 'notifications', 'payments', 'vouchers', 'discordUser'];
const ALLOWED_FILTERS = ['name', 'server_limit', 'email', 'pterodactyl_id', 'role', 'suspended'];
@ -95,7 +92,7 @@ class UserController extends Controller
//Update Users Password on Pterodactyl
//Username,Mail,First and Lastname are required aswell
$response = Pterodactyl::client()->patch('/application/users/' . $user->pterodactyl_id, [
$response = Pterodactyl::client()->patch('/application/users/'.$user->pterodactyl_id, [
'username' => $request->name,
'first_name' => $request->name,
'last_name' => $request->name,
@ -232,7 +229,7 @@ class UserController extends Controller
$discordUser = DiscordUser::find($id);
$user = $discordUser ? $discordUser->user : User::findOrFail($id);
if (!$user->isSuspended()) {
if (! $user->isSuspended()) {
throw ValidationException::withMessages([
'error' => 'You cannot unsuspend an User who is not suspended.',
]);
@ -243,6 +240,21 @@ class UserController extends Controller
return $user;
}
/**
* Create a unique Referral Code for User
*
* @return string
*/
protected function createReferralCode()
{
$referralcode = STR::random(8);
if (User::where('referral_code', '=', $referralcode)->exists()) {
$this->createReferralCode();
}
return $referralcode;
}
/**
* @throws ValidationException
*/
@ -255,7 +267,7 @@ class UserController extends Controller
]);
// Prevent the creation of new users via API if this is enabled.
if (!config('SETTINGS::SYSTEM:CREATION_OF_NEW_USERS', 'true')) {
if (! config('SETTINGS::SYSTEM:CREATION_OF_NEW_USERS', 'true')) {
throw ValidationException::withMessages([
'error' => 'The creation of new users has been blocked by the system administrator.',
]);
@ -293,7 +305,7 @@ class UserController extends Controller
'pterodactyl_id' => $response->json()['attributes']['id'],
]);
//INCREMENT REFERRAL-USER CREDITS
if (!empty($request->input('referral_code'))) {
if (! empty($request->input('referral_code'))) {
$ref_code = $request->input('referral_code');
$new_user = $user->id;
if ($ref_user = User::query()->where('referral_code', '=', $ref_code)->first()) {

View file

@ -7,13 +7,11 @@ use App\Http\Controllers\Controller;
use App\Models\User;
use App\Notifications\ReferralNotification;
use App\Providers\RouteServiceProvider;
use App\Traits\Referral;
use Carbon\Carbon;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
@ -31,7 +29,7 @@ class RegisterController extends Controller
|
*/
use RegistersUsers, Referral;
use RegistersUsers;
/**
* Where to redirect users after registration.
@ -88,6 +86,21 @@ class RegisterController extends Controller
return Validator::make($data, $validationRules);
}
/**
* Create a unique Referral Code for User
*
* @return string
*/
protected function createReferralCode()
{
$referralcode = STR::random(8);
if (User::where('referral_code', '=', $referralcode)->exists()) {
$this->createReferralCode();
}
return $referralcode;
}
/**
* Create a new user instance after a valid registration.
*
@ -119,7 +132,6 @@ class RegisterController extends Controller
if ($response->failed()) {
$user->delete();
Log::error('Pterodactyl Registration Error: ' . $response->json()['errors'][0]['detail']);
throw ValidationException::withMessages([
'ptero_registration_error' => [__('Account already exists on Pterodactyl. Please contact the Support!')],
]);
@ -130,7 +142,7 @@ class RegisterController extends Controller
]);
//INCREMENT REFERRAL-USER CREDITS
if (!empty($data['referral_code'])) {
if (! empty($data['referral_code'])) {
$ref_code = $data['referral_code'];
$new_user = $user->id;
if ($ref_user = User::query()->where('referral_code', '=', $ref_code)->first()) {
@ -142,7 +154,7 @@ class RegisterController extends Controller
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 . ')');
->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([

View file

@ -25,18 +25,16 @@ class HomeController extends Controller
$this->middleware('auth');
}
/*
* TODO: This is commented due to the fact the market is a bad dependency, will be changed later.
public function callHome()
{
if (Storage::exists('callHome')) {
return;
}
Http::asForm()->post('https://market.ctrlpanel.gg/callhome.php', [
Http::asForm()->post('https://market.controlpanel.gg/callhome.php', [
'id' => Hash::make(URL::current()),
]);
Storage::put('callHome', 'This is only used to count the installations of cpgg.');
}*/
}
/**
* @description Get the Background Color for the Days-Left-Box in HomeView
@ -107,13 +105,13 @@ class HomeController extends Controller
$unit = $daysLeft < 1 ? ($hoursLeft < 1 ? null : __('hours')) : __('days');
}
//$this->callhome(); TODO: Same as the function
$this->callhome();
// RETURN ALL VALUES
return view('home')->with([
'usage' => $usage,
'credits' => $credits,
'useful_links_dashboard' => UsefulLink::where("position","like","%dashboard%")->get()->sortby("id"),
'useful_links' => UsefulLink::all()->sortBy('id'),
'bg' => $bg,
'boxText' => $boxText,
'unit' => $unit,

View file

@ -1,117 +0,0 @@
<?php
namespace App\Http\Controllers\Moderation;
use App\Http\Controllers\Controller;
use App\Models\Ticket;
use App\Models\TicketCategory;
use Illuminate\Http\Request;
class TicketCategoryController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$categories = TicketCategory::all();
return view('moderator.ticket.category')->with("categories",$categories);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'name' => 'required|string|max:191',
]);
TicketCategory::create($request->all());
return redirect(route("moderator.ticket.category.index"))->with("success",__("Category created"));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function update(Request $request)
{
$request->validate([
'category' => 'required|int',
'name' => 'required|string|max:191',
]);
$category = TicketCategory::where("id",$request->category)->firstOrFail();
$category->name = $request->name;
$category->save();
return redirect()->back()->with("success",__("Category name updated"));
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$category = TicketCategory::where("id",$id)->firstOrFail();
if($category->id == 5 ){ //cannot delete "other" category
return back()->with("error","You cannot delete that category");
}
$tickets = Ticket::where("ticketcategory_id",$category->id)->get();
foreach($tickets as $ticket){
$ticket->ticketcategory_id = "5";
$ticket->save();
}
$category->delete();
return redirect()
->route('moderator.ticket.category.index')
->with('success', __('Category removed'));
}
public function datatable()
{
$query = TicketCategory::withCount("tickets");
return datatables($query)
->addColumn('name', function ( TicketCategory $category) {
return $category->name;
})
->editColumn('tickets', function ( TicketCategory $category) {
return $category->tickets_count;
})
->addColumn('actions', function (TicketCategory $category) {
return '
<form class="d-inline" onsubmit="return submitResult();" method="post" action="'.route('moderator.ticket.category.destroy', $category->id).'">
'.csrf_field().'
'.method_field('DELETE').'
<button data-content="'.__('Delete').'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
</form>
';
})
->editColumn('created_at', function (TicketCategory $category) {
return $category->created_at ? $category->created_at->diffForHumans() : '';
})
->rawColumns(['actions'])
->make();
}
}

View file

@ -25,12 +25,7 @@ class TicketsController extends Controller
public function show($ticket_id)
{
try {
$ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
} catch (Exception $e)
{
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
$ticketcomments = $ticket->ticketcomments;
$ticketcategory = $ticket->ticketcategory;
$server = Server::where('id', $ticket->server)->first();
@ -38,20 +33,9 @@ class TicketsController extends Controller
return view('moderator.ticket.show', compact('ticket', 'ticketcategory', 'ticketcomments', 'server'));
}
public function changeStatus($ticket_id)
public function close($ticket_id)
{
try {
$ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
} catch(Exception $e)
{
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
if($ticket->status == "Closed"){
$ticket->status = "Reopened";
$ticket->save();
return redirect()->back()->with('success', __('A ticket has been reopened, ID: #') . $ticket->ticket_id);
}
$ticket->status = 'Closed';
$ticket->save();
$ticketOwner = $ticket->user;
@ -61,13 +45,7 @@ class TicketsController extends Controller
public function delete($ticket_id)
{
try {
$ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
} catch (Exception $e)
{
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
TicketComment::where('ticket_id', $ticket->id)->delete();
$ticket->delete();
@ -77,11 +55,7 @@ class TicketsController extends Controller
public function reply(Request $request)
{
$this->validate($request, ['ticketcomment' => 'required']);
try {
$ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail();
} catch (Exception $e){
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
$ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail();
$ticket->status = 'Answered';
$ticket->update();
TicketComment::create([
@ -89,12 +63,7 @@ class TicketsController extends Controller
'user_id' => Auth::user()->id,
'ticketcomment' => $request->input('ticketcomment'),
]);
try {
$user = User::where('id', $ticket->user_id)->firstOrFail();
} catch(Exception $e)
{
return redirect()->back()->with('warning', __('User not found on the server. Check on the admin database or try again later.'));
}
$newmessage = $request->input('ticketcomment');
$user->notify(new ReplyNotification($ticket, $user, $newmessage));
@ -116,16 +85,12 @@ class TicketsController extends Controller
return '<a href="'.route('admin.users.show', $tickets->user->id).'">'.$tickets->user->name.'</a>';
})
->addColumn('actions', function (Ticket $tickets) {
$statusButtonColor = ($tickets->status == "Closed") ? 'btn-success' : 'btn-warning';
$statusButtonIcon = ($tickets->status == "Closed") ? 'fa-redo' : 'fa-times';
$statusButtonText = ($tickets->status == "Closed") ? __('Reopen') : __('Close');
return '
<a data-content="'.__('View').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('moderator.ticket.show', ['ticket_id' => $tickets->ticket_id]).'" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-eye"></i></a>
<form class="d-inline" method="post" action="'.route('moderator.ticket.changeStatus', ['ticket_id' => $tickets->ticket_id]).'">
<form class="d-inline" method="post" action="'.route('moderator.ticket.close', ['ticket_id' => $tickets->ticket_id]).'">
'.csrf_field().'
'.method_field('POST').'
<button data-content="'.__($statusButtonText).'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm text-white '.$statusButtonColor.' mr-1"><i class="fas '.$statusButtonIcon.'"></i></button>
<button data-content="'.__('Close').'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm text-white btn-warning mr-1"><i class="fas fa-times"></i></button>
</form>
<form class="d-inline" method="post" action="'.route('moderator.ticket.delete', ['ticket_id' => $tickets->ticket_id]).'">
'.csrf_field().'
@ -136,7 +101,6 @@ class TicketsController extends Controller
})
->editColumn('status', function (Ticket $tickets) {
switch ($tickets->status) {
case 'Reopened':
case 'Open':
$badgeColor = 'badge-success';
break;
@ -171,13 +135,8 @@ class TicketsController extends Controller
public function blacklistAdd(Request $request)
{
try {
$user = User::where('id', $request->user_id)->firstOrFail();
$user = User::where('id', $request->user_id)->first();
$check = TicketBlacklist::where('user_id', $user->id)->first();
}
catch (Exception $e){
return redirect()->back()->with('warning', __('User not found on the server. Check the admin database or try again later.'));
}
if ($check) {
$check->reason = $request->reason;
$check->status = 'True';
@ -204,12 +163,7 @@ class TicketsController extends Controller
public function blacklistChange($id)
{
try {
$blacklist = TicketBlacklist::where('id', $id)->first();
}
catch (Exception $e){
return redirect()->back()->with('warning', __('User not found on the server. Check the admin database or try again later.'));
}
$blacklist = TicketBlacklist::where('id', $id)->first();
if ($blacklist->status == 'True') {
$blacklist->status = 'False';
} else {

View file

@ -1,8 +1,7 @@
<?php
namespace App\Http\Controllers\Admin;
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\PartnerDiscount;
use App\Models\User;
use Illuminate\Http\Request;
@ -41,19 +40,26 @@ class PartnerController extends Controller
'registered_user_discount' => 'required|integer|max:100|min:0',
]);
if(PartnerDiscount::where("user_id",$request->user_id)->exists()){
return redirect()->route('admin.partners.index')->with('error', __('Partner already exists'));
}
PartnerDiscount::create($request->all());
return redirect()->route('admin.partners.index')->with('success', __('partner has been created!'));
}
/**
* Display the specified resource.
*
* @param Voucher $voucher
* @return Response
*/
public function show(Voucher $voucher)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param Partner $partner
* @param Voucher $voucher
* @return Application|Factory|View
*/
public function edit(PartnerDiscount $partner)
@ -69,7 +75,7 @@ class PartnerController extends Controller
* Update the specified resource in storage.
*
* @param Request $request
* @param Partner $partner
* @param Voucher $voucher
* @return RedirectResponse
*/
public function update(Request $request, PartnerDiscount $partner)
@ -89,7 +95,7 @@ class PartnerController extends Controller
/**
* Remove the specified resource from storage.
*
* @param Partner $partner
* @param Voucher $voucher
* @return RedirectResponse
*/
public function destroy(PartnerDiscount $partner)
@ -99,7 +105,81 @@ class PartnerController extends Controller
return redirect()->back()->with('success', __('partner has been removed!'));
}
public function users(Voucher $voucher)
{
return view('admin.vouchers.users', [
'voucher' => $voucher,
]);
}
/**
* @param Request $request
* @return JsonResponse
*
* @throws ValidationException
*/
public function redeem(Request $request)
{
//general validations
$request->validate([
'code' => 'required|exists:vouchers,code',
]);
//get voucher by code
$voucher = Voucher::where('code', '=', $request->input('code'))->firstOrFail();
//extra validations
if ($voucher->getStatus() == 'USES_LIMIT_REACHED') {
throw ValidationException::withMessages([
'code' => __('This voucher has reached the maximum amount of uses'),
]);
}
if ($voucher->getStatus() == 'EXPIRED') {
throw ValidationException::withMessages([
'code' => __('This voucher has expired'),
]);
}
if (! $request->user()->vouchers()->where('id', '=', $voucher->id)->get()->isEmpty()) {
throw ValidationException::withMessages([
'code' => __('You already redeemed this voucher code'),
]);
}
if ($request->user()->credits + $voucher->credits >= 99999999) {
throw ValidationException::withMessages([
'code' => "You can't redeem this voucher because you would exceed the limit of ".CREDITS_DISPLAY_NAME,
]);
}
//redeem voucher
$voucher->redeem($request->user());
event(new UserUpdateCreditsEvent($request->user()));
return response()->json([
'success' => "{$voucher->credits} ".CREDITS_DISPLAY_NAME.' '.__('have been added to your balance!'),
]);
}
public function usersDataTable(Voucher $voucher)
{
$users = $voucher->users();
return datatables($users)
->editColumn('name', function (User $user) {
return '<a class="text-info" target="_blank" href="'.route('admin.users.show', $user->id).'">'.$user->name.'</a>';
})
->addColumn('credits', function (User $user) {
return '<i class="fas fa-coins mr-2"></i> '.$user->credits();
})
->addColumn('last_seen', function (User $user) {
return $user->last_seen ? $user->last_seen->diffForHumans() : '';
})
->rawColumns(['name', 'credits', 'last_seen'])
->make();
}
public function dataTable()
{

View file

@ -26,50 +26,53 @@ class TicketsController extends Controller
return view('ticket.index', compact('tickets', 'ticketcategories'));
}
public function create()
{
//check in blacklist
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
if ($check && $check->status == 'True') {
return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '".$check->reason."', please contact the administrator"));
}
$ticketcategories = TicketCategory::all();
$servers = Auth::user()->servers;
return view('ticket.create', compact('ticketcategories', 'servers'));
}
public function store(Request $request)
{
$this->validate($request, [
'title' => 'required',
'ticketcategory' => 'required',
'priority' => 'required',
'message' => 'required',]
'title' => 'required',
'ticketcategory' => 'required',
'priority' => 'required',
'message' => 'required', ]
);
$ticket = new Ticket([
'title' => $request->input('title'),
'user_id' => Auth::user()->id,
'ticket_id' => strtoupper(Str::random(8)),
'ticketcategory_id' => $request->input('ticketcategory'),
'priority' => $request->input('priority'),
'message' => $request->input('message'),
'status' => 'Open',
'server' => $request->input('server'),]
'title' => $request->input('title'),
'user_id' => Auth::user()->id,
'ticket_id' => strtoupper(Str::random(5)),
'ticketcategory_id' => $request->input('ticketcategory'),
'priority' => $request->input('priority'),
'message' => $request->input('message'),
'status' => 'Open',
'server' => $request->input('server'), ]
);
$ticket->save();
$user = Auth::user();
if (config('SETTINGS::TICKET:NOTIFY') == "all") {
$admin = User::where('role', 'admin')->orWhere('role', 'mod')->get();
}
if (config('SETTINGS::TICKET:NOTIFY') == "admin") {
$admin = User::where('role', 'admin')->get();
}
if (config('SETTINGS::TICKET:NOTIFY') == "moderator") {
$admin = User::where('role', 'mod')->get();
}
if(config('SETTINGS::TICKET:NOTIFY') == "all"){ $admin = User::where('role', 'admin')->orWhere('role', 'mod')->get();}
if(config('SETTINGS::TICKET:NOTIFY') == "admin"){ $admin = User::where('role', 'admin')->get();}
if(config('SETTINGS::TICKET:NOTIFY') == "moderator"){ $admin = User::where('role', 'mod')->get();}
$user->notify(new CreateNotification($ticket));
if (config('SETTINGS::TICKET:NOTIFY') != "none") {
if(config('SETTINGS::TICKET:NOTIFY') != "none"){
Notification::send($admin, new AdminCreateNotification($ticket, $user));
}
return redirect()->route('ticket.index')->with('success', __('A ticket has been opened, ID: #') . $ticket->ticket_id);
return redirect()->route('ticket.index')->with('success', __('A ticket has been opened, ID: #').$ticket->ticket_id);
}
public function show($ticket_id)
{
try {
$ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
} catch (Exception $e) {
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
$ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
$ticketcomments = $ticket->ticketcomments;
$ticketcategory = $ticket->ticketcategory;
$server = Server::where('id', $ticket->server)->first();
@ -82,14 +85,10 @@ class TicketsController extends Controller
//check in blacklist
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
if ($check && $check->status == 'True') {
return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator"));
return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '".$check->reason."', please contact the administrator"));
}
$this->validate($request, ['ticketcomment' => 'required']);
try {
$ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail();
} catch (Exception $e) {
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
$ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail();
$ticket->status = 'Client Reply';
$ticket->update();
$ticketcomment = TicketComment::create([
@ -105,32 +104,9 @@ class TicketsController extends Controller
return redirect()->back()->with('success', __('Your comment has been submitted'));
}
public function create()
public function close($ticket_id)
{
//check in blacklist
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
if ($check && $check->status == 'True') {
return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator"));
}
$ticketcategories = TicketCategory::all();
$servers = Auth::user()->servers;
return view('ticket.create', compact('ticketcategories', 'servers'));
}
public function changeStatus($ticket_id)
{
try {
$ticket = Ticket::where('user_id', Auth::user()->id)->where("ticket_id", $ticket_id)->firstOrFail();
} catch (Exception $e) {
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
if ($ticket->status == "Closed") {
$ticket->status = "Reopened";
$ticket->save();
return redirect()->back()->with('success', __('A ticket has been reopened, ID: #') . $ticket->ticket_id);
}
$ticket = Ticket::where('user_id', Auth::user()->id)->where("ticket_id", $ticket_id)->firstOrFail();
$ticket->status = "Closed";
$ticket->save();
return redirect()->back()->with('success', __('A ticket has been closed, ID: #') . $ticket->ticket_id);
@ -145,11 +121,10 @@ class TicketsController extends Controller
return $tickets->ticketcategory->name;
})
->editColumn('title', function (Ticket $tickets) {
return '<a class="text-info" href="' . route('ticket.show', ['ticket_id' => $tickets->ticket_id]) . '">' . '#' . $tickets->ticket_id . ' - ' . htmlspecialchars($tickets->title) . '</a>';
return '<a class="text-info" href="'.route('ticket.show', ['ticket_id' => $tickets->ticket_id]).'">'.'#'.$tickets->ticket_id.' - '.htmlspecialchars($tickets->title).'</a>';
})
->editColumn('status', function (Ticket $tickets) {
switch ($tickets->status) {
case 'Reopened':
case 'Open':
$badgeColor = 'badge-success';
break;
@ -164,26 +139,21 @@ class TicketsController extends Controller
break;
}
return '<span class="badge ' . $badgeColor . '">' . $tickets->status . '</span>';
return '<span class="badge '.$badgeColor.'">'.$tickets->status.'</span>';
})
->editColumn('priority', function (Ticket $tickets) {
return __($tickets->priority);
})
->editColumn('updated_at', function (Ticket $tickets) {
return ['display' => $tickets->updated_at ? $tickets->updated_at->diffForHumans() : '',
'raw' => $tickets->updated_at ? strtotime($tickets->updated_at) : ''];
return $tickets->updated_at ? $tickets->updated_at->diffForHumans() : '';
})
->addColumn('actions', function (Ticket $tickets) {
$statusButtonColor = ($tickets->status == "Closed") ? 'btn-success' : 'btn-warning';
$statusButtonIcon = ($tickets->status == "Closed") ? 'fa-redo' : 'fa-times';
$statusButtonText = ($tickets->status == "Closed") ? __('Reopen') : __('Close');
return '
<a data-content="' . __('View') . '" data-toggle="popover" data-trigger="hover" data-placement="top" href="' . route('ticket.show', ['ticket_id' => $tickets->ticket_id]) . '" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-eye"></i></a>
<form class="d-inline" method="post" action="' . route('ticket.changeStatus', ['ticket_id' => $tickets->ticket_id]) . '">
' . csrf_field() . '
' . method_field('POST') . '
<button data-content="' . __($statusButtonText) . '" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm text-white ' . $statusButtonColor . ' mr-1"><i class="fas ' . $statusButtonIcon . '"></i></button>
<a data-content="'.__('View').'" data-toggle="popover" data-trigger="hover" data-placement="top" href="'.route('ticket.show', ['ticket_id' => $tickets->ticket_id]).'" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-eye"></i></a>
<form class="d-inline" method="post" action="'.route('ticket.close', ['ticket_id' => $tickets->ticket_id]).'">
'.csrf_field().'
'.method_field('POST').'
<button data-content="'.__('Close').'" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm text-white btn-warning mr-1"><i class="fas fa-times"></i></button>
</form>
</form>

View file

@ -22,10 +22,9 @@ class Verified
*/
public function handle($event)
{
if (!$event->user->email_verified_reward) {
if (! $event->user->email_verified_reward) {
$event->user->increment('server_limit', config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL'));
$event->user->increment('credits', config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL'));
$event->user->update(['email_verified_reward' => true]);
}
}
}

View file

@ -13,7 +13,6 @@ class Payment extends Model
use HasFactory;
public $incrementing = false;
protected $primaryKey = 'id';
/**
* @var string[]

View file

@ -10,6 +10,6 @@ class TicketCategory extends Model
public function tickets()
{
return $this->hasMany(Ticket::class,'ticketcategory_id');
return $this->hasMany(Ticket::class);
}
}

View file

@ -16,6 +16,5 @@ class UsefulLink extends Model
'title',
'link',
'description',
'position',
];
}

View file

@ -61,7 +61,6 @@ class User extends Authenticatable implements MustVerifyEmail
'avatar',
'suspended',
'referral_code',
'email_verified_reward'
];
/**
@ -84,7 +83,6 @@ class User extends Authenticatable implements MustVerifyEmail
'last_seen' => 'datetime',
'credits' => 'float',
'server_limit' => 'float',
'email_verified_reward' => 'boolean'
];
public static function boot()
@ -96,16 +94,23 @@ class User extends Authenticatable implements MustVerifyEmail
});
static::deleting(function (User $user) {
// delete every server the user owns without using chunks
$user->servers()->each(function ($server) {
$server->delete();
$user->servers()->chunk(10, function ($servers) {
foreach ($servers as $server) {
$server->delete();
}
});
$user->payments()->delete();
$user->payments()->chunk(10, function ($payments) {
foreach ($payments as $payment) {
$payment->delete();
}
});
$user->tickets()->delete();
$user->tickets()->chunk(10, function ($tickets) {
foreach ($tickets as $ticket) {
$ticket->delete();
}
});
$user->ticketBlackList()->delete();
@ -233,17 +238,17 @@ class User extends Authenticatable implements MustVerifyEmail
public function getAvatar()
{
//TODO loading the images to confirm they exist is causing to much load time. alternative has to be found :) maybe onerror tag on the <img tags>
// if ($this->discordUser()->exists()) {
// if(@getimagesize($this->discordUser->getAvatar())) {
// $avatar = $this->discordUser->getAvatar();
// } else {
// $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
// }
// } else {
// $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
// }
// if ($this->discordUser()->exists()) {
// if(@getimagesize($this->discordUser->getAvatar())) {
// $avatar = $this->discordUser->getAvatar();
// } else {
// $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
// }
// } else {
// $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
// }
return 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($this->email)));
return 'https://www.gravatar.com/avatar/'.md5(strtolower(trim($this->email)));
}
/**
@ -286,15 +291,16 @@ class User extends Authenticatable implements MustVerifyEmail
public function reVerifyEmail()
{
$this->forceFill([
'email_verified_at' => null
'email_verified_at' => null,
])->save();
}
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->logOnly(['role', 'name', 'server_limit', 'pterodactyl_id', 'email'])
->logOnlyDirty()
->dontSubmitEmptyLogs();
-> logOnly(['role', 'name', 'server_limit', 'pterodactyl_id', 'email'])
-> logOnlyDirty()
-> dontSubmitEmptyLogs();
}
}

View file

@ -3,7 +3,6 @@
namespace App\Providers;
use App\Models\Settings;
use App\Models\UsefulLink;
use Exception;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Artisan;
@ -46,23 +45,14 @@ class AppServiceProvider extends ServiceProvider
}
//if none of result array is true. it sets ok to false
if (!in_array(true, $result)) {
if (! in_array(true, $result)) {
$ok = false;
$validator->setCustomMessages(['multiple_date_format' => 'The format must be one of ' . implode(',', $parameters)]);
$validator->setCustomMessages(['multiple_date_format' => 'The format must be one of '.implode(',', $parameters)]);
}
return $ok;
});
try {
if (Schema::hasColumn('useful_links', 'position')) {
$useful_links = UsefulLink::where("position", "like", "%topbar%")->get()->sortby("id");
view()->share('useful_links', $useful_links);
}
} catch (Exception $e) {
Log::error("Couldnt find useful_links. Probably the installation is not completet. " . $e);
}
//only run if the installer has been executed
try {
$settings = Settings::all();
@ -71,14 +61,12 @@ class AppServiceProvider extends ServiceProvider
config([$setting->key => $setting->value]);
}
if (!file_exists(base_path('themes') . "/" . config("SETTINGS::SYSTEM:THEME"))) {
if(!file_exists(base_path('themes')."/".config("SETTINGS::SYSTEM:THEME"))){
config(['SETTINGS::SYSTEM:THEME' => "default"]);
}
if (config('SETTINGS::SYSTEM:THEME') && config('SETTINGS::SYSTEM:THEME') !== config('theme.active')) {
Theme::set(config("SETTINGS::SYSTEM:THEME", "default"), "default");
} else {
Theme::set("default", "default");
if(config('theme.active') == null){
Theme::set(config("SETTINGS::SYSTEM:THEME","default"), "default");
}
// Set Mail Config
@ -128,7 +116,7 @@ class AppServiceProvider extends ServiceProvider
}
try {
$stringfromfile = file(base_path() . '/.git/HEAD');
$stringfromfile = file(base_path().'/.git/HEAD');
$firstLine = $stringfromfile[0]; //get the string from the array
@ -137,7 +125,7 @@ class AppServiceProvider extends ServiceProvider
$branchname = $explodedstring[2]; //get the one that is always the branch name
} catch (Exception $e) {
$branchname = 'unknown';
Log::notice($e);
Log::error($e);
}
config(['BRANCHNAME' => $branchname]);

View file

@ -7,12 +7,11 @@ use App\Events\UserUpdateCreditsEvent;
use App\Listeners\CreateInvoice;
use App\Listeners\UnsuspendServers;
use App\Listeners\UserPayment;
use App\Listeners\Verified as VerifiedListener;
use App\Listeners\Verified;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use SocialiteProviders\Manager\SocialiteWasCalled;
use Illuminate\Auth\Events\Verified;
class EventServiceProvider extends ServiceProvider
{
@ -36,8 +35,8 @@ class EventServiceProvider extends ServiceProvider
// ... other providers
'SocialiteProviders\\Discord\\DiscordExtendSocialite@handle',
],
Verified::class => [
VerifiedListener::class,
'Illuminate\Auth\Events\Verified' => [
Verified::class,
],
];

View file

@ -1,23 +0,0 @@
<?php
namespace App\Traits;
use App\Models\User;
use Illuminate\Support\Str;
trait Referral
{
public function createReferralCode()
{
$code = Str::random(8);
// check if code already exists
if (User::where('referral_code', $code)->exists()) {
// if exists, generate another code
return $this->generateReferralCode();
}
return $code;
}
}

361
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d98e4be75e05c71049fe452b69b54901",
"content-hash": "be76c9bab8622d363a4eb843794e9e3e",
"packages": [
{
"name": "aws/aws-crt-php",
@ -58,16 +58,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.257.5",
"version": "3.255.9",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "c600a07da531d6c29af791b9d2e8b6df796aa14b"
"reference": "a001ab98b9e76a6f5cae327b3316b08fab37a296"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c600a07da531d6c29af791b9d2e8b6df796aa14b",
"reference": "c600a07da531d6c29af791b9d2e8b6df796aa14b",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a001ab98b9e76a6f5cae327b3316b08fab37a296",
"reference": "a001ab98b9e76a6f5cae327b3316b08fab37a296",
"shasum": ""
},
"require": {
@ -146,9 +146,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.257.5"
"source": "https://github.com/aws/aws-sdk-php/tree/3.255.9"
},
"time": "2023-01-20T19:34:14+00:00"
"time": "2023-01-04T19:24:09+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
@ -524,16 +524,16 @@
},
{
"name": "doctrine/dbal",
"version": "3.5.3",
"version": "3.5.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "88fa7e5189fd5ec6682477044264dc0ed4e3aa1e"
"reference": "63e513cebbbaf96a6795e5c5ee34d205831bfc85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/88fa7e5189fd5ec6682477044264dc0ed4e3aa1e",
"reference": "88fa7e5189fd5ec6682477044264dc0ed4e3aa1e",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/63e513cebbbaf96a6795e5c5ee34d205831bfc85",
"reference": "63e513cebbbaf96a6795e5c5ee34d205831bfc85",
"shasum": ""
},
"require": {
@ -548,7 +548,7 @@
"require-dev": {
"doctrine/coding-standard": "11.0.0",
"jetbrains/phpstorm-stubs": "2022.3",
"phpstan/phpstan": "1.9.4",
"phpstan/phpstan": "1.9.2",
"phpstan/phpstan-strict-rules": "^1.4",
"phpunit/phpunit": "9.5.27",
"psalm/plugin-phpunit": "0.18.4",
@ -615,7 +615,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/3.5.3"
"source": "https://github.com/doctrine/dbal/tree/3.5.2"
},
"funding": [
{
@ -631,7 +631,7 @@
"type": "tidelift"
}
],
"time": "2023-01-12T10:21:44+00:00"
"time": "2022-12-19T08:17:34+00:00"
},
{
"name": "doctrine/deprecations",
@ -860,27 +860,28 @@
},
{
"name": "doctrine/lexer",
"version": "3.0.0",
"version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "84a527db05647743d50373e0ec53a152f2cde568"
"reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568",
"reference": "84a527db05647743d50373e0ec53a152f2cde568",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124",
"reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124",
"shasum": ""
},
"require": {
"php": "^8.1"
"doctrine/deprecations": "^1.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^10",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5",
"doctrine/coding-standard": "^9 || ^10",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psalm/plugin-phpunit": "^0.18.3",
"vimeo/psalm": "^5.0"
"vimeo/psalm": "^4.11 || ^5.0"
},
"type": "library",
"autoload": {
@ -917,7 +918,7 @@
],
"support": {
"issues": "https://github.com/doctrine/lexer/issues",
"source": "https://github.com/doctrine/lexer/tree/3.0.0"
"source": "https://github.com/doctrine/lexer/tree/2.1.0"
},
"funding": [
{
@ -933,7 +934,7 @@
"type": "tidelift"
}
],
"time": "2022-12-15T16:57:16+00:00"
"time": "2022-12-14T08:49:07+00:00"
},
{
"name": "dompdf/dompdf",
@ -1060,26 +1061,26 @@
},
{
"name": "egulias/email-validator",
"version": "4.0.1",
"version": "3.2.5",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
"reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff"
"reference": "b531a2311709443320c786feb4519cfaf94af796"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/3a85486b709bc384dae8eb78fb2eec649bdb64ff",
"reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b531a2311709443320c786feb4519cfaf94af796",
"reference": "b531a2311709443320c786feb4519cfaf94af796",
"shasum": ""
},
"require": {
"doctrine/lexer": "^2.0 || ^3.0",
"php": ">=8.1",
"symfony/polyfill-intl-idn": "^1.26"
"doctrine/lexer": "^1.2|^2",
"php": ">=7.2",
"symfony/polyfill-intl-idn": "^1.15"
},
"require-dev": {
"phpunit/phpunit": "^9.5.27",
"vimeo/psalm": "^4.30"
"phpunit/phpunit": "^8.5.8|^9.3.3",
"vimeo/psalm": "^4"
},
"suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
@ -1087,7 +1088,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
"dev-master": "3.0.x-dev"
}
},
"autoload": {
@ -1115,7 +1116,7 @@
],
"support": {
"issues": "https://github.com/egulias/EmailValidator/issues",
"source": "https://github.com/egulias/EmailValidator/tree/4.0.1"
"source": "https://github.com/egulias/EmailValidator/tree/3.2.5"
},
"funding": [
{
@ -1123,7 +1124,7 @@
"type": "github"
}
],
"time": "2023-01-14T14:17:03+00:00"
"time": "2023-01-02T17:26:14+00:00"
},
{
"name": "facade/ignition-contracts",
@ -1701,29 +1702,29 @@
},
{
"name": "kkomelin/laravel-translatable-string-exporter",
"version": "1.18.0",
"version": "1.17.0",
"source": {
"type": "git",
"url": "https://github.com/kkomelin/laravel-translatable-string-exporter.git",
"reference": "c8b3364816d9f0ad2865c7538d8eb29ed8319136"
"reference": "0425f2c3add32df852c002b11bffe72c9c67ec89"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kkomelin/laravel-translatable-string-exporter/zipball/c8b3364816d9f0ad2865c7538d8eb29ed8319136",
"reference": "c8b3364816d9f0ad2865c7538d8eb29ed8319136",
"url": "https://api.github.com/repos/kkomelin/laravel-translatable-string-exporter/zipball/0425f2c3add32df852c002b11bffe72c9c67ec89",
"reference": "0425f2c3add32df852c002b11bffe72c9c67ec89",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/support": "^8|^9",
"illuminate/translation": "^8|^9",
"php": "^8.0",
"symfony/finder": "^5|^6"
"illuminate/support": "^5.4|^6|^7|^8|^9",
"illuminate/translation": "^5.4|^6|^7|^8|^9",
"php": "^7.2|^8.0",
"symfony/finder": "^3.2|^4|^5|^6"
},
"require-dev": {
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^6.0|^7.0",
"phpunit/phpunit": "^9.0"
"orchestra/testbench": "^3.4|^4.0|^5.0|^6.0|^7.0",
"phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0"
},
"type": "library",
"extra": {
@ -1760,29 +1761,28 @@
],
"support": {
"issues": "https://github.com/kkomelin/laravel-translatable-string-exporter/issues",
"source": "https://github.com/kkomelin/laravel-translatable-string-exporter/tree/1.18.0"
"source": "https://github.com/kkomelin/laravel-translatable-string-exporter/tree/1.17.0"
},
"time": "2023-01-12T15:11:42+00:00"
"time": "2022-06-13T07:13:55+00:00"
},
{
"name": "laravel/framework",
"version": "v9.48.0",
"version": "v9.46.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "c78ae7aeb0cbcb1a205050d3592247ba07f5b711"
"reference": "62b05b6de5733d89378a279e40230a71e5ab5d92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/c78ae7aeb0cbcb1a205050d3592247ba07f5b711",
"reference": "c78ae7aeb0cbcb1a205050d3592247ba07f5b711",
"url": "https://api.github.com/repos/laravel/framework/zipball/62b05b6de5733d89378a279e40230a71e5ab5d92",
"reference": "62b05b6de5733d89378a279e40230a71e5ab5d92",
"shasum": ""
},
"require": {
"brick/math": "^0.10.2",
"doctrine/inflector": "^2.0",
"dragonmantank/cron-expression": "^3.3.2",
"egulias/email-validator": "^3.2.1|^4.0",
"egulias/email-validator": "^3.2.1",
"ext-mbstring": "*",
"ext-openssl": "*",
"fruitcake/php-cors": "^1.2",
@ -1867,12 +1867,10 @@
"mockery/mockery": "^1.5.1",
"orchestra/testbench-core": "^7.16",
"pda/pheanstalk": "^4.0",
"phpstan/phpdoc-parser": "^1.15",
"phpstan/phpstan": "^1.4.7",
"phpunit/phpunit": "^9.5.8",
"predis/predis": "^1.1.9|^2.0.2",
"symfony/cache": "^6.0",
"symfony/http-client": "^6.0"
"symfony/cache": "^6.0"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
@ -1951,7 +1949,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-01-17T15:06:19+00:00"
"time": "2023-01-03T15:12:31+00:00"
},
{
"name": "laravel/serializable-closure",
@ -2015,30 +2013,30 @@
},
{
"name": "laravel/socialite",
"version": "v5.6.1",
"version": "v5.5.7",
"source": {
"type": "git",
"url": "https://github.com/laravel/socialite.git",
"reference": "a14a177f2cc71d8add71e2b19e00800e83bdda09"
"reference": "ee6201f539ac47c3a55132449f9d20ee928f0ee2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/socialite/zipball/a14a177f2cc71d8add71e2b19e00800e83bdda09",
"reference": "a14a177f2cc71d8add71e2b19e00800e83bdda09",
"url": "https://api.github.com/repos/laravel/socialite/zipball/ee6201f539ac47c3a55132449f9d20ee928f0ee2",
"reference": "ee6201f539ac47c3a55132449f9d20ee928f0ee2",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0|^7.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0",
"illuminate/http": "^6.0|^7.0|^8.0|^9.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
"league/oauth1-client": "^1.10.1",
"php": "^7.2|^8.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0",
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0",
"phpunit/phpunit": "^8.0|^9.3"
},
"type": "library",
@ -2080,26 +2078,26 @@
"issues": "https://github.com/laravel/socialite/issues",
"source": "https://github.com/laravel/socialite"
},
"time": "2023-01-20T15:42:35+00:00"
"time": "2022-12-28T12:35:23+00:00"
},
{
"name": "laravel/tinker",
"version": "v2.8.0",
"version": "v2.7.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/tinker.git",
"reference": "74d0b287cc4ae65d15c368dd697aae71d62a73ad"
"reference": "5062061b4924af3392225dd482ca7b4d85d8b8ef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/tinker/zipball/74d0b287cc4ae65d15c368dd697aae71d62a73ad",
"reference": "74d0b287cc4ae65d15c368dd697aae71d62a73ad",
"url": "https://api.github.com/repos/laravel/tinker/zipball/5062061b4924af3392225dd482ca7b4d85d8b8ef",
"reference": "5062061b4924af3392225dd482ca7b4d85d8b8ef",
"shasum": ""
},
"require": {
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/console": "^6.0|^7.0|^8.0|^9.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
"php": "^7.2.5|^8.0",
"psy/psysh": "^0.10.4|^0.11.1",
"symfony/var-dumper": "^4.3.4|^5.0|^6.0"
@ -2109,7 +2107,7 @@
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"suggest": {
"illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0)."
"illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0)."
},
"type": "library",
"extra": {
@ -2146,9 +2144,9 @@
],
"support": {
"issues": "https://github.com/laravel/tinker/issues",
"source": "https://github.com/laravel/tinker/tree/v2.8.0"
"source": "https://github.com/laravel/tinker/tree/v2.7.3"
},
"time": "2023-01-10T18:03:30+00:00"
"time": "2022-11-09T15:11:38+00:00"
},
{
"name": "laravel/ui",
@ -2467,16 +2465,16 @@
},
{
"name": "league/flysystem",
"version": "3.12.2",
"version": "3.12.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "f6377c709d2275ed6feaf63e44be7a7162b0e77f"
"reference": "2aef65a47e44f2d6f9938f720f6dd697e7ba7b76"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f6377c709d2275ed6feaf63e44be7a7162b0e77f",
"reference": "f6377c709d2275ed6feaf63e44be7a7162b0e77f",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/2aef65a47e44f2d6f9938f720f6dd697e7ba7b76",
"reference": "2aef65a47e44f2d6f9938f720f6dd697e7ba7b76",
"shasum": ""
},
"require": {
@ -2493,7 +2491,7 @@
"require-dev": {
"async-aws/s3": "^1.5",
"async-aws/simple-s3": "^1.1",
"aws/aws-sdk-php": "^3.220.0",
"aws/aws-sdk-php": "^3.198.1",
"composer/semver": "^3.0",
"ext-fileinfo": "*",
"ext-ftp": "*",
@ -2538,7 +2536,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.12.2"
"source": "https://github.com/thephpleague/flysystem/tree/3.12.0"
},
"funding": [
{
@ -2554,24 +2552,24 @@
"type": "tidelift"
}
],
"time": "2023-01-19T12:02:19+00:00"
"time": "2022-12-20T20:21:10+00:00"
},
{
"name": "league/flysystem-aws-s3-v3",
"version": "3.12.2",
"version": "3.10.3",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
"reference": "645e14e4a80bd2da8b01e57388e7296a695a80c2"
"reference": "f593bf91f94f2adf4f71513d29f1dfa693f2f640"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/645e14e4a80bd2da8b01e57388e7296a695a80c2",
"reference": "645e14e4a80bd2da8b01e57388e7296a695a80c2",
"url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/f593bf91f94f2adf4f71513d29f1dfa693f2f640",
"reference": "f593bf91f94f2adf4f71513d29f1dfa693f2f640",
"shasum": ""
},
"require": {
"aws/aws-sdk-php": "^3.220.0",
"aws/aws-sdk-php": "^3.132.4",
"league/flysystem": "^3.10.0",
"league/mime-type-detection": "^1.0.0",
"php": "^8.0.2"
@ -2608,7 +2606,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues",
"source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.12.2"
"source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.10.3"
},
"funding": [
{
@ -2624,7 +2622,7 @@
"type": "tidelift"
}
],
"time": "2023-01-17T14:15:08+00:00"
"time": "2022-10-26T18:15:09+00:00"
},
{
"name": "league/mime-type-detection",
@ -2992,16 +2990,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.65.0",
"version": "2.64.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "09acf64155c16dc6f580f36569ae89344e9734a3"
"reference": "f2e59963f4c4f4fdfb9fcfd752e8d2e2b79a4e2c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/09acf64155c16dc6f580f36569ae89344e9734a3",
"reference": "09acf64155c16dc6f580f36569ae89344e9734a3",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f2e59963f4c4f4fdfb9fcfd752e8d2e2b79a4e2c",
"reference": "f2e59963f4c4f4fdfb9fcfd752e8d2e2b79a4e2c",
"shasum": ""
},
"require": {
@ -3090,7 +3088,7 @@
"type": "tidelift"
}
],
"time": "2023-01-06T15:55:01+00:00"
"time": "2023-01-01T23:17:36+00:00"
},
{
"name": "nette/schema",
@ -3156,16 +3154,16 @@
},
{
"name": "nette/utils",
"version": "v3.2.9",
"version": "v3.2.8",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c"
"reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c",
"reference": "c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c",
"url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
"reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
"shasum": ""
},
"require": {
@ -3175,7 +3173,6 @@
"nette/di": "<3.0.6"
},
"require-dev": {
"jetbrains/phpstorm-attributes": "dev-master",
"nette/tester": "~2.0",
"phpstan/phpstan": "^1.0",
"tracy/tracy": "^2.3"
@ -3236,22 +3233,22 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v3.2.9"
"source": "https://github.com/nette/utils/tree/v3.2.8"
},
"time": "2023-01-18T03:26:20+00:00"
"time": "2022-09-12T23:36:20+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.15.3",
"version": "v4.15.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039"
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039",
"reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
"shasum": ""
},
"require": {
@ -3292,9 +3289,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2"
},
"time": "2023-01-16T22:05:37+00:00"
"time": "2022-11-12T15:38:23+00:00"
},
{
"name": "nunomaduro/termwind",
@ -4441,16 +4438,16 @@
},
{
"name": "ramsey/uuid",
"version": "4.7.3",
"version": "4.7.1",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "433b2014e3979047db08a17a205f410ba3869cf2"
"reference": "a1acf96007170234a8399586a6e2ab8feba109d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/433b2014e3979047db08a17a205f410ba3869cf2",
"reference": "433b2014e3979047db08a17a205f410ba3869cf2",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/a1acf96007170234a8399586a6e2ab8feba109d1",
"reference": "a1acf96007170234a8399586a6e2ab8feba109d1",
"shasum": ""
},
"require": {
@ -4517,7 +4514,7 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.7.3"
"source": "https://github.com/ramsey/uuid/tree/4.7.1"
},
"funding": [
{
@ -4529,7 +4526,7 @@
"type": "tidelift"
}
],
"time": "2023-01-12T18:13:24+00:00"
"time": "2022-12-31T22:20:34+00:00"
},
{
"name": "sabberworm/php-css-parser",
@ -4792,25 +4789,25 @@
},
{
"name": "spatie/laravel-package-tools",
"version": "1.14.0",
"version": "1.13.8",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-package-tools.git",
"reference": "9964e65c318c30577ca1b91469f739d2b381359b"
"reference": "781a2f637237e69c277eb401063acf15e2b4156b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/9964e65c318c30577ca1b91469f739d2b381359b",
"reference": "9964e65c318c30577ca1b91469f739d2b381359b",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/781a2f637237e69c277eb401063acf15e2b4156b",
"reference": "781a2f637237e69c277eb401063acf15e2b4156b",
"shasum": ""
},
"require": {
"illuminate/contracts": "^9.28|^10.0",
"illuminate/contracts": "^9.28",
"php": "^8.0"
},
"require-dev": {
"mockery/mockery": "^1.5",
"orchestra/testbench": "^7.7|^8.0",
"orchestra/testbench": "^7.7",
"pestphp/pest": "^1.22",
"phpunit/phpunit": "^9.5.24",
"spatie/pest-plugin-test-time": "^1.1"
@ -4840,7 +4837,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-package-tools/issues",
"source": "https://github.com/spatie/laravel-package-tools/tree/1.14.0"
"source": "https://github.com/spatie/laravel-package-tools/tree/1.13.8"
},
"funding": [
{
@ -4848,7 +4845,7 @@
"type": "github"
}
],
"time": "2023-01-10T14:09:55+00:00"
"time": "2022-12-20T14:09:05+00:00"
},
{
"name": "spatie/laravel-query-builder",
@ -5666,16 +5663,16 @@
},
{
"name": "symfony/http-client-contracts",
"version": "v3.2.0",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client-contracts.git",
"reference": "c5f587eb445224ddfeb05b5ee703476742d730bf"
"reference": "fd038f08c623ab5d22b26e9ba35afe8c79071800"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c5f587eb445224ddfeb05b5ee703476742d730bf",
"reference": "c5f587eb445224ddfeb05b5ee703476742d730bf",
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/fd038f08c623ab5d22b26e9ba35afe8c79071800",
"reference": "fd038f08c623ab5d22b26e9ba35afe8c79071800",
"shasum": ""
},
"require": {
@ -5687,7 +5684,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.3-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -5727,7 +5724,7 @@
"standards"
],
"support": {
"source": "https://github.com/symfony/http-client-contracts/tree/v3.2.0"
"source": "https://github.com/symfony/http-client-contracts/tree/v3.1.1"
},
"funding": [
{
@ -5743,7 +5740,7 @@
"type": "tidelift"
}
],
"time": "2022-11-25T10:21:52+00:00"
"time": "2022-04-22T07:30:54+00:00"
},
{
"name": "symfony/http-foundation",
@ -6017,29 +6014,28 @@
},
{
"name": "symfony/mailer",
"version": "6.3.x-dev",
"version": "v6.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/mailer.git",
"reference": "de3acc2fbc81d26957b551aabeea8b6cb0dc1f72"
"reference": "b355ad81f1d2987c47dcd3b04d5dce669e1e62e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mailer/zipball/de3acc2fbc81d26957b551aabeea8b6cb0dc1f72",
"reference": "de3acc2fbc81d26957b551aabeea8b6cb0dc1f72",
"url": "https://api.github.com/repos/symfony/mailer/zipball/b355ad81f1d2987c47dcd3b04d5dce669e1e62e6",
"reference": "b355ad81f1d2987c47dcd3b04d5dce669e1e62e6",
"shasum": ""
},
"require": {
"egulias/email-validator": "^2.1.10|^3|^4",
"egulias/email-validator": "^2.1.10|^3",
"php": ">=8.1",
"psr/event-dispatcher": "^1",
"psr/log": "^1|^2|^3",
"symfony/event-dispatcher": "^5.4|^6.0",
"symfony/mime": "^6.2",
"symfony/service-contracts": "^2.5|^3"
"symfony/service-contracts": "^1.1|^2|^3"
},
"conflict": {
"symfony/http-client-contracts": "<2.5",
"symfony/http-kernel": "<5.4",
"symfony/messenger": "<6.2",
"symfony/mime": "<6.2",
@ -6047,7 +6043,7 @@
},
"require-dev": {
"symfony/console": "^5.4|^6.0",
"symfony/http-client-contracts": "^2.5|^3",
"symfony/http-client-contracts": "^1.1|^2|^3",
"symfony/messenger": "^6.2",
"symfony/twig-bridge": "^6.2"
},
@ -6077,7 +6073,7 @@
"description": "Helps sending emails",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/mailer/tree/6.3"
"source": "https://github.com/symfony/mailer/tree/v6.2.2"
},
"funding": [
{
@ -6093,7 +6089,7 @@
"type": "tidelift"
}
],
"time": "2023-01-23T14:48:49+00:00"
"time": "2022-12-14T16:11:27+00:00"
},
{
"name": "symfony/mailgun-mailer",
@ -8004,30 +8000,30 @@
},
{
"name": "doctrine/instantiator",
"version": "2.0.0",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
"reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
"reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
"reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
"shasum": ""
},
"require": {
"php": "^8.1"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^11",
"doctrine/coding-standard": "^9 || ^11",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^1.2",
"phpstan/phpstan": "^1.9.4",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^9.5.27",
"vimeo/psalm": "^5.4"
"phpbench/phpbench": "^0.16 || ^1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.30 || ^5.4"
},
"type": "library",
"autoload": {
@ -8054,7 +8050,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/2.0.0"
"source": "https://github.com/doctrine/instantiator/tree/1.5.0"
},
"funding": [
{
@ -8070,7 +8066,7 @@
"type": "tidelift"
}
],
"time": "2022-12-30T00:23:10+00:00"
"time": "2022-12-30T00:15:36+00:00"
},
{
"name": "fakerphp/faker",
@ -8264,22 +8260,22 @@
},
{
"name": "laravel/sail",
"version": "v1.18.1",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "a64f78a4ab86c04a4c5de39bea20a8d36ad48a22"
"reference": "7d69da7b2bdb8cbe8da6663eb2ae0e00c884bf80"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/a64f78a4ab86c04a4c5de39bea20a8d36ad48a22",
"reference": "a64f78a4ab86c04a4c5de39bea20a8d36ad48a22",
"url": "https://api.github.com/repos/laravel/sail/zipball/7d69da7b2bdb8cbe8da6663eb2ae0e00c884bf80",
"reference": "7d69da7b2bdb8cbe8da6663eb2ae0e00c884bf80",
"shasum": ""
},
"require": {
"illuminate/console": "^8.0|^9.0|^10.0",
"illuminate/contracts": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0",
"illuminate/console": "^8.0|^9.0",
"illuminate/contracts": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"php": "^7.3|^8.0"
},
"bin": [
@ -8320,7 +8316,7 @@
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2023-01-11T14:35:04+00:00"
"time": "2022-12-22T14:46:08+00:00"
},
{
"name": "maximebf/debugbar",
@ -9038,20 +9034,20 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.28",
"version": "9.5.27",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "954ca3113a03bf780d22f07bf055d883ee04b65e"
"reference": "a2bc7ffdca99f92d959b3f2270529334030bba38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e",
"reference": "954ca3113a03bf780d22f07bf055d883ee04b65e",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38",
"reference": "a2bc7ffdca99f92d959b3f2270529334030bba38",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.3.1 || ^2",
"doctrine/instantiator": "^1.3.1",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
@ -9120,7 +9116,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27"
},
"funding": [
{
@ -9136,7 +9132,7 @@
"type": "tidelift"
}
],
"time": "2023-01-14T12:32:24+00:00"
"time": "2022-12-09T07:31:23+00:00"
},
{
"name": "sebastian/cli-parser",
@ -10166,16 +10162,16 @@
},
{
"name": "spatie/flare-client-php",
"version": "1.3.3",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/spatie/flare-client-php.git",
"reference": "f5aea0629d1fff794b2aabbcd483bd83824b112f"
"reference": "609903bd154ba3d71f5e23a91c3b431fa8f71868"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/f5aea0629d1fff794b2aabbcd483bd83824b112f",
"reference": "f5aea0629d1fff794b2aabbcd483bd83824b112f",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/609903bd154ba3d71f5e23a91c3b431fa8f71868",
"reference": "609903bd154ba3d71f5e23a91c3b431fa8f71868",
"shasum": ""
},
"require": {
@ -10223,7 +10219,7 @@
],
"support": {
"issues": "https://github.com/spatie/flare-client-php/issues",
"source": "https://github.com/spatie/flare-client-php/tree/1.3.3"
"source": "https://github.com/spatie/flare-client-php/tree/1.3.2"
},
"funding": [
{
@ -10231,20 +10227,20 @@
"type": "github"
}
],
"time": "2022-12-26T14:37:55+00:00"
"time": "2022-12-26T14:36:46+00:00"
},
{
"name": "spatie/ignition",
"version": "1.4.2",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/ignition.git",
"reference": "79a2eedbfa88955bb41411e61f7db9134c9a6a82"
"reference": "dd3d456779108d7078baf4e43f8c2b937d9794a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/ignition/zipball/79a2eedbfa88955bb41411e61f7db9134c9a6a82",
"reference": "79a2eedbfa88955bb41411e61f7db9134c9a6a82",
"url": "https://api.github.com/repos/spatie/ignition/zipball/dd3d456779108d7078baf4e43f8c2b937d9794a1",
"reference": "dd3d456779108d7078baf4e43f8c2b937d9794a1",
"shasum": ""
},
"require": {
@ -10306,7 +10302,7 @@
"type": "github"
}
],
"time": "2023-01-23T15:14:00+00:00"
"time": "2022-08-26T11:51:15+00:00"
},
{
"name": "spatie/laravel-ignition",
@ -10455,12 +10451,9 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.1",
"php": "^8.0|^7.4",
"ext-intl": "*"
},
"platform-dev": [],
"platform-overrides": {
"php": "8.1"
},
"plugin-api-version": "2.1.0"
}

View file

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Facade;
return [
'version' => '0.9.8',
'version' => '0.9',
/*
|--------------------------------------------------------------------------
@ -17,7 +17,7 @@ return [
|
*/
'name' => env('APP_NAME', 'Ctrlpanel.gg'),
'name' => env('APP_NAME', 'Controlpanel.gg'),
/*
|--------------------------------------------------------------------------

View file

@ -9,7 +9,7 @@ return [
| It will assign the default active theme to be used if one is not set during
| runtime.
*/
'active' => "default",
'active' => null,
/*
|--------------------------------------------------------------------------

View file

@ -14,7 +14,7 @@ return [
*/
'paths' => [
base_path('themes'),
resource_path('views'),
],
/*

View file

@ -1,7 +1,6 @@
<?php
use App\Models\User;
use App\Traits\Referral;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
@ -10,13 +9,16 @@ use Illuminate\Support\Str;
return new class extends Migration
{
use Referral;
public function setReferralCode($userid)
public function generateCode($userid)
{
$code = $this->createReferralCode();
DB::table('users')
->where('id', '=', $userid)
->update(['referral_code' => $code]);
$random = STR::random(8);
if (User::where('referral_code', '=', $random)->doesntExist()) {
DB::table('users')
->where('id', '=', $userid)
->update(['referral_code' => $random]);
} else {
$this->generateCode($userid);
}
}
/**
@ -33,7 +35,7 @@ return new class extends Migration
$existing_user = User::where('referral_code', '')->orWhere('referral_code', null)->get();
foreach ($existing_user as $user) {
$this->setReferralCode($user->id);
$this->generateCode($user->id);
}
}

View file

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('useful_links', function (Blueprint $table) {
$table->string('position')->after("description")->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('useful_links', function (Blueprint $table) {
$table->dropColumn('position');
});
}
};

View file

@ -131,7 +131,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 'Credits',
'type' => 'string',
'description' => 'The display name of your currency.',
'description' => 'Set the display name of your currency :)',
]);
//credits display name
@ -148,7 +148,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '0',
'type' => 'integer',
'description' => 'The %-value of tax that will be added to the product price on checkout.',
'description' => 'The %-value of tax that will be added to the product price on checkout',
]);
//Invoices enabled
Settings::firstOrCreate([
@ -156,7 +156,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 'false',
'type' => 'boolean',
'description' => 'Enables or disables the invoice feature for payments.',
'description' => 'Enables or disables the invoice feature for payments',
]);
//Invoice company name
Settings::firstOrCreate([
@ -164,7 +164,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The name of the Company on the Invoices.',
'description' => 'The name of the Company on the Invoices',
]);
//Invoice company address
Settings::firstOrCreate([
@ -172,7 +172,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The address of the Company on the Invoices.',
'description' => 'The address of the Company on the Invoices',
]);
//Invoice company phone
Settings::firstOrCreate([
@ -180,7 +180,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The phone number of the Company on the Invoices.',
'description' => 'The phone number of the Company on the Invoices',
]);
//Invoice company mail
@ -189,7 +189,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The email address of the Company on the Invoices.',
'description' => 'The email address of the Company on the Invoices',
]);
//Invoice VAT
@ -198,7 +198,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The VAT-Number of the Company on the Invoices.',
'description' => 'The VAT-Number of the Company on the Invoices',
]);
//Invoice Website
@ -207,7 +207,7 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The Website of the Company on the Invoices.',
'description' => 'The Website of the Company on the Invoices',
]);
//Invoice Website
@ -216,7 +216,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 'INV',
'type' => 'string',
'description' => 'The invoice prefix.',
'description' => 'The invoice prefix',
]);
//Locale
@ -225,7 +225,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 'en',
'type' => 'string',
'description' => 'The default dashboard language.',
'description' => 'The default Language the dashboard will be shown in',
]);
//Dynamic locale
Settings::firstOrCreate([
@ -247,9 +247,9 @@ class SettingsSeeder extends Seeder
Settings::firstOrCreate([
'key' => 'SETTINGS::LOCALE:AVAILABLE',
], [
'value' => 'en',
'value' => '',
'type' => 'string',
'description' => 'The available languages.',
'description' => 'The available languages',
]);
//Locale
Settings::firstOrCreate([
@ -265,63 +265,63 @@ class SettingsSeeder extends Seeder
], [
'value' => env('PAYPAL_SECRET', ''),
'type' => 'string',
'description' => 'Your PayPal Secret-Key (https://developer.paypal.com/docs/integration/direct/rest/).',
'description' => 'Your PayPal Secret-Key ( https://developer.paypal.com/docs/integration/direct/rest/)',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID',
], [
'value' => env('PAYPAL_CLIENT_ID', ''),
'type' => 'string',
'description' => 'Your PayPal Client_ID.',
'description' => 'Your PayPal Client_ID',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET',
], [
'value' => env('PAYPAL_SANDBOX_SECRET', ''),
'type' => 'string',
'description' => 'Your PayPal SANDBOX Secret-Key used for testing.',
'description' => 'Your PayPal SANDBOX Secret-Key used for testing ',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:PAYPAL:SANDBOX_CLIENT_ID',
], [
'value' => env('PAYPAL_SANDBOX_CLIENT_ID', ''),
'type' => 'string',
'description' => 'Your PayPal SANDBOX Client-ID used for testing.',
'description' => 'Your PayPal SANDBOX Client-ID used for testing ',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:STRIPE:SECRET',
], [
'value' => env('STRIPE_SECRET', ''),
'type' => 'string',
'description' => 'Your Stripe Secret-Key (https://dashboard.stripe.com/account/apikeys).',
'description' => 'Your Stripe Secret-Key ( https://dashboard.stripe.com/account/apikeys )',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:STRIPE:ENDPOINT_SECRET',
], [
'value' => env('STRIPE_ENDPOINT_SECRET', ''),
'type' => 'string',
'description' => 'Your Stripe endpoint secret-key.',
'description' => 'Your Stripe endpoint secret-key',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:STRIPE:TEST_SECRET',
], [
'value' => env('STRIPE_TEST_SECRET', ''),
'type' => 'string',
'description' => 'Your Stripe test secret-key.',
'description' => 'Your Stripe test secret-key',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:STRIPE:ENDPOINT_TEST_SECRET',
], [
'value' => env('STRIPE_ENDPOINT_TEST_SECRET', ''),
'type' => 'string',
'description' => 'Your Stripe endpoint test secret-key.',
'description' => 'Your Stripe endpoint test secret-key',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::PAYMENTS:STRIPE:METHODS',
], [
'value' => env('STRIPE_METHODS', 'card,sepa_debit'),
'type' => 'string',
'description' => 'Comma seperated list of payment methods that are enabled (https://stripe.com/docs/payments/payment-methods/integration-options).',
'description' => 'Comma seperated list of payment methods that are enabled (https://stripe.com/docs/payments/payment-methods/integration-options)',
]);
Settings::firstOrCreate([
@ -329,7 +329,7 @@ class SettingsSeeder extends Seeder
], [
'value' => env('DISCORD_CLIENT_ID', ''),
'type' => 'string',
'description' => 'Discord API Credentials (https://discordapp.com/developers/applications/).',
'description' => 'Discord API Credentials - https://discordapp.com/developers/applications/',
]);
Settings::firstOrCreate([
@ -337,14 +337,14 @@ class SettingsSeeder extends Seeder
], [
'value' => env('DISCORD_CLIENT_SECRET', ''),
'type' => 'string',
'description' => 'Discord API Credentials (https://discordapp.com/developers/applications/).',
'description' => 'Discord API Credentials - https://discordapp.com/developers/applications/',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::DISCORD:BOT_TOKEN',
], [
'value' => env('DISCORD_BOT_TOKEN', ''),
'type' => 'string',
'description' => 'Discord API Credentials (https://discordapp.com/developers/applications/).',
'description' => 'Discord API Credentials - https://discordapp.com/developers/applications/',
]);
Settings::firstOrCreate([
@ -352,7 +352,7 @@ class SettingsSeeder extends Seeder
], [
'value' => env('DISCORD_GUILD_ID', ''),
'type' => 'string',
'description' => 'Discord API Credentials (https://discordapp.com/developers/applications/).',
'description' => 'Discord API Credentials - https://discordapp.com/developers/applications/',
]);
Settings::firstOrCreate([
@ -360,14 +360,14 @@ class SettingsSeeder extends Seeder
], [
'value' => env('DISCORD_ROLE_ID', ''),
'type' => 'string',
'description' => 'Discord role that will be assigned to users when they register.',
'description' => 'Discord role that will be assigned to users when they register',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::DISCORD:INVITE_URL',
], [
'value' => env('DISCORD_INVITE_URL', ''),
'type' => 'string',
'description' => 'The invite URL to your Discord Server.',
'description' => 'The invite URL to your Discord Server',
]);
Settings::firstOrCreate([
@ -404,7 +404,7 @@ class SettingsSeeder extends Seeder
], [
'value' => env('RECAPTCHA_SITE_KEY', '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'),
'type' => 'string',
'description' => 'Google Recaptcha API Credentials (https://www.google.com/recaptcha/admin) - reCaptcha V2 (not v3)',
'description' => 'Google Recaptcha API Credentials - https://www.google.com/recaptcha/admin - reCaptcha V2 (not v3)',
]);
Settings::firstOrCreate([
@ -412,14 +412,14 @@ class SettingsSeeder extends Seeder
], [
'value' => env('RECAPTCHA_SECRET_KEY', '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe'),
'type' => 'string',
'description' => 'Google Recaptcha API Credentials (https://www.google.com/recaptcha/admin) - reCaptcha V2 (not v3)',
'description' => 'Google Recaptcha API Credentials - https://www.google.com/recaptcha/admin - reCaptcha V2 (not v3)',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::RECAPTCHA:ENABLED',
], [
'value' => 'true',
'type' => 'boolean',
'description' => 'Enables or disables the ReCaptcha feature on the registration/login page.',
'description' => 'Enables or disables the ReCaptcha feature on the registration/login page',
]);
Settings::firstOrCreate([
@ -427,63 +427,63 @@ class SettingsSeeder extends Seeder
], [
'value' => env('MAIL_MAILER', 'smtp'),
'type' => 'string',
'description' => 'Selected Mailer (smtp, mailgun, sendgrid, mailtrap).',
'description' => 'Selected Mailer (smtp, mailgun, sendgrid, mailtrap)',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:HOST',
], [
'value' => env('MAIL_HOST', 'localhost'),
'type' => 'string',
'description' => 'Mailer Host Address.',
'description' => 'Mailer Host Address',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:PORT',
], [
'value' => env('MAIL_PORT', '25'),
'type' => 'string',
'description' => 'Mailer Server Port.',
'description' => 'Mailer Server Port',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:USERNAME',
], [
'value' => env('MAIL_USERNAME', ''),
'type' => 'string',
'description' => 'Mailer Username.',
'description' => 'Mailer Username',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:PASSWORD',
], [
'value' => env('MAIL_PASSWORD', ''),
'type' => 'string',
'description' => 'Mailer Password.',
'description' => 'Mailer Password',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:ENCRYPTION',
], [
'value' => env('MAIL_ENCRYPTION', 'tls'),
'type' => 'string',
'description' => 'Mailer Encryption (tls, ssl).',
'description' => 'Mailer Encryption (tls, ssl)',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:FROM_ADDRESS',
], [
'value' => env('MAIL_FROM_ADDRESS', ''),
'type' => 'string',
'description' => 'Mailer From Address.',
'description' => 'Mailer From Address',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::MAIL:FROM_NAME',
], [
'value' => env('APP_NAME', 'Ctrlpanel'),
'value' => env('APP_NAME', 'Controlpanel'),
'type' => 'string',
'description' => 'Mailer From Name.',
'description' => 'Mailer From Name',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::REFERRAL::ENABLED',
], [
'value' => 'false',
'type' => 'string',
'description' => 'Enable or disable the referral system.',
'description' => 'Enable or disable the referral system',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::REFERRAL::ALWAYS_GIVE_COMMISSION',
@ -518,7 +518,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 100,
'type' => 'integer',
'description' => 'The Percentage value a referred user gets.',
'description' => 'The Percentage Value a referred user gets',
]);
Settings::firstOrCreate([
@ -526,28 +526,28 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'string',
'description' => 'The Client API Key of an Pterodactyl Admin Account.',
'description' => 'The Client API Key of an Pterodactyl Admin Account',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:ENABLE_UPGRADE',
], [
'value' => 'false',
'type' => 'boolean',
'description' => 'Enables the updgrade/downgrade feature for servers.',
'description' => 'Enables the updgrade/downgrade feature for servers',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:CREATION_OF_NEW_SERVERS',
], [
'value' => 'true',
'type' => 'boolean',
'description' => 'Enable creation of new servers',
'description' => 'Enable/disable the creation of new servers',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:CREATION_OF_NEW_USERS',
], [
'value' => 'true',
'value' => 'false',
'type' => 'boolean',
'description' => 'Enable creation of new users',
'description' => 'Enable/disable the creation of new users',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SHOW_IMPRINT',
@ -555,7 +555,7 @@ class SettingsSeeder extends Seeder
'value' => "false",
'type' => 'boolean',
'description' => 'Enable imprint in footer.'
'description' => 'Enable/disable imprint in footer'
]);
Settings::firstOrCreate([
@ -564,7 +564,7 @@ class SettingsSeeder extends Seeder
'value' => "false",
'type' => 'boolean',
'description' => 'Enable privacy policy in footer.'
'description' => 'Enable/disable privacy policy in footer'
]);
Settings::firstOrCreate([
@ -572,7 +572,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 'false',
'type' => 'boolean',
'description' => 'Enable Terms of Service in footer.',
'description' => 'Enable/disable Terms of Service in footer',
]);
Settings::firstOrCreate([
@ -580,14 +580,14 @@ class SettingsSeeder extends Seeder
], [
'value' => 'false',
'type' => 'boolean',
'description' => 'Enable Alerts on Homepage.',
'description' => 'Enable/disable Alerts on Homepage',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:ALERT_TYPE',
], [
'value' => 'dark',
'type' => 'text',
'description' => 'Changes the Color of the Alert.',
'description' => 'Changes the Color of the Alert',
]);
Settings::firstOrCreate([
@ -595,14 +595,14 @@ class SettingsSeeder extends Seeder
], [
'value' => '',
'type' => 'text',
'description' => 'Changes the Content the Alert.',
'description' => 'Changes the Content the Alert',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:THEME',
], [
'value' => 'default',
'type' => 'text',
'description' => 'Current active theme.',
'description' => 'Current active theme',
]);
Settings::firstOrCreate([
@ -610,7 +610,7 @@ class SettingsSeeder extends Seeder
], [
'value' => 'true',
'type' => 'boolean',
'description' => 'Enable Useful Links on Homepage.',
'description' => 'Enable/disable Useful Links on Homepage',
]);
Settings::firstOrCreate([
@ -618,24 +618,24 @@ class SettingsSeeder extends Seeder
], [
'value' => 'true',
'type' => 'boolean',
'description' => 'Enable MOTD on Homepage.',
'description' => 'Enable/disable MOTD on Homepage',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:MOTD_MESSAGE',
], [
'value' => '<h1 style="text-align: center;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://ctrlpanel.gg/img/controlpanel.png" alt="" width="200" height="200"><span style="font-size: 36pt;">Ctrlpanel.gg</span></h1>
'value' => '<h1 style="text-align: center;"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://controlpanel.gg/img/controlpanel.png" alt="" width="200" height="200"><span style="font-size: 36pt;">Controlpanel.gg</span></h1>
<p><span style="font-size: 18pt;">Thank you for using our Software</span></p>
<p><span style="font-size: 18pt;">If you have any questions, make sure to join our <a href="https://discord.com/invite/4Y6HjD2uyU" target="_blank" rel="noopener">Discord</a></span></p>
<p><span style="font-size: 10pt;">(you can change this message in the <a href="admin/settings#system">Settings</a> )</span></p>',
'type' => 'text',
'description' => 'MOTD Message.',
'description' => 'MOTD Message',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SEO_TITLE',
], [
'value' => 'Ctrlpanel.gg',
'value' => 'Controlpanel.gg',
'type' => 'text',
'description' => 'The SEO Title.',
'description' => 'The SEO Title',
]);
Settings::firstOrCreate([
@ -643,14 +643,14 @@ class SettingsSeeder extends Seeder
], [
'value' => 'Billing software for Pterodactyl Dashboard!',
'type' => 'text',
'description' => 'SEO Description.',
'description' => 'SEO Description',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::TICKET:NOTIFY',
], [
'value' => 'all',
'type' => 'text',
'description' => 'Who will get a Email Notifcation on new Tickets.',
'description' => 'Who will get a Email Notifcation on new Tickets',
]);
}
}

View file

@ -19,21 +19,18 @@ class UsefulLinksSeeder extends Seeder
'title' => 'Pterodactyl Panel',
'link' => env('PTERODACTYL_URL', 'http://localhost'),
'description' => 'Use your servers on our pterodactyl panel <small>(You can use the same login details)</small>',
'position' => 'dashboard',
]);
UsefulLink::create([
'icon' => 'fas fa-database',
'title' => 'phpMyAdmin',
'link' => env('PHPMYADMIN_URL', 'http://localhost'),
'description' => 'View your database online using phpMyAdmin',
'position' => 'dashboard,topbar',
]);
UsefulLink::create([
'icon' => 'fab fa-discord',
'title' => 'Discord',
'link' => env('DISCORD_INVITE_URL', 'https://discord.gg/4Y6HjD2uyU'),
'description' => 'Need a helping hand? Want to chat? Got any questions? Join our discord!',
'position' => 'dashboard',
]);
}
}

View file

@ -12,7 +12,7 @@ services:
ports:
- 80:80
volumes:
- "../:/var/www/html"
- "../:/var/www/html:delegated"
depends_on:
- php
- mysql
@ -42,7 +42,7 @@ services:
dockerfile: docker/php/Dockerfile
container_name: controlpanel_php
volumes:
- "../:/var/www/html"
- "../:/var/www/html:delegated"
networks:
- laravel

View file

@ -1,14 +1,16 @@
FROM php:8.1-fpm-buster
RUN apt-get update \
&& apt-get install -y build-essential zlib1g-dev default-mysql-client curl gnupg procps vim git unzip libzip-dev libpq-dev libicu-dev libonig-dev libpng-dev libjpeg-dev libfreetype6-dev
FROM php:8.0-fpm-alpine3.13
RUN docker-php-ext-install mysqli pdo pdo_mysql intl zip gd bcmath
RUN apk update && apk upgrade
RUN apk add --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/community/
RUN apk add --no-cache curl-dev icu-dev libzip-dev
RUN docker-php-ext-install mysqli pdo pdo_mysql intl zip
ADD ./docker/php/www.conf /usr/local/etc/php-fpm.d/
RUN mkdir -p /var/www/html
RUN addgroup --gid 1000 laravel && adduser --ingroup laravel --uid 1000 --shell /bin/sh --disabled-password --gecos "" laravel
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel
RUN chown laravel:laravel /var/www/html
WORKDIR /var/www/html

View file

@ -160,7 +160,7 @@
"Support server": "Support server",
"Documentation": "Documentation",
"Github": "Github",
"Support CtrlPanel": "Support CtrlPanel",
"Support ControlPanel": "Support ControlPanel",
"Servers": "Servers",
"Total": "Total",
"Payments": "Payments",
@ -177,13 +177,13 @@
"Title": "Title",
"User": "User",
"Last updated": "Last updated",
"Ctrlpanel.gg": "Ctrlpanel.gg",
"Controlpanel.gg": "Controlpanel.gg",
"Version": "Version",
"Individual nodes": "Individual nodes",
"You reached the Pterodactyl perPage limit. Please make sure to set it higher than your server count.": "You reached the Pterodactyl perPage limit. Please make sure to set it higher than your server count.",
"You can do that in settings.": "You can do that in settings.",
"Note": "Note",
"If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on CtrlPanel. Try clicking the button below.": "If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on CtrlPanel. Try clicking the button below.",
"If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on ControlPanel. Try clicking the button below.": "If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on ControlPanel. Try clicking the button below.",
"Sync servers": "Sync servers",
"Node": "Node",
"Server count": "Server count",
@ -256,9 +256,9 @@
"You usually do not need to change anything here": "You usually do not need to change anything here",
"Edit Server": "Edit Server",
"Server identifier": "Server identifier",
"Change the server identifier on ctrlpanel to match a pterodactyl server.": "Change the server identifier on ctrlpanel to match a pterodactyl server.",
"Change the server identifier on controlpanel to match a pterodactyl server.": "Change the server identifier on controlpanel to match a pterodactyl server.",
"Server owner": "Server owner",
"Change the current server owner on ctrlpanel and pterodactyl.": "Change the current server owner on ctrlpanel and pterodactyl.",
"Change the current server owner on controlpanel and pterodactyl.": "Change the current server owner on controlpanel and pterodactyl.",
"Server id": "Server id",
"Config": "Config",
"Suspended at": "Suspended at",

25041
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,23 @@
{
"private": true,
"scripts": {
"development": "vite",
"production": "vite build"
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production",
"dev:default": "vite --config themes/default/vite.config.js",
"build:default": "vite build --config themes/default/vite.config.js",
"dev:1day2die": "vite --config themes/1day2die/vite.config.js",
"build:1day2die": "vite build --config themes/1day2die/vite.config.js"
},
"devDependencies": {
"axios": "^0.25",
"bootstrap": "^4.6.0",
"jquery": "^3.5",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"popper.js": "^1.16",
"postcss": "^8.1.14",
@ -16,8 +26,6 @@
"sass-loader": "^10.1.1"
},
"dependencies": {
"tinymce": "^6.3.1",
"vite": "^4.0.4",
"laravel-vite-plugin": "^0.7.3"
"tinymce": "^6.3.1"
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,7 +0,0 @@
{
"themes/default/sass/app.scss": {
"file": "assets/app-bac23d88.css",
"src": "themes/default/sass/app.scss",
"isEntry": true
}
}

View file

@ -8,7 +8,7 @@ if (file_exists('../../install.lock')) {
<html>
<head>
<title>Ctrlpanel.gg installer Script</title>
<title>Controlpanel.gg installer Script</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<style>
@ -48,7 +48,7 @@ if (file_exists('../../install.lock')) {
$cardheader = '
<div class="card card-outline-success bg-dark">
<div class="card-header text-center">
<b class="mr-1 text-light">Ctrlpanel.GG</b>
<b class="mr-1 text-light">Controlpanel.GG</b>
</div>
<div class="card-body bg-light">';
@ -57,7 +57,7 @@ if (! isset($_GET['step'])) {
echo run_console('cp .env.example .env');
}
echo $cardheader; ?>
<p class="login-box-msg">This installer will lead you through the most crucial Steps of Ctrlpanel.gg`s
<p class="login-box-msg">This installer will lead you through the most crucial Steps of Controlpanel.gg`s
setup</p>
<p class="<?php echo checkHTTPS() == true ? 'ok' : 'notok'; ?>">HTTPS is required</p>
@ -218,7 +218,7 @@ if (isset($_GET['step']) && $_GET['step'] == 2) {
<label for="name">Your Host-Name</label>
<input id="name" name="name" type="text"
required
value="Ctrlpanel.gg" class="form-control">
value="Controlpanel.gg" class="form-control">
</div>
</div>

4
public/mix-manifest.json Normal file
View file

@ -0,0 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}

View file

@ -1 +0,0 @@
@import "default.css";.layout-fixed .wrapper .sidebar{ height:calc(100vh - 3.5rem - 1px);background:radial-gradient(#061b29,black);}body:not(.sidebar-mini-md) .content-wrapper,body:not(.sidebar-mini-md) .main-footer,body:not(.sidebar-mini-md) .main-header{ transition:margin-left .3s ease-in-out;background:radial-gradient(#061b29,black);}[class*=sidebar-dark] .brand-link,[class*=sidebar-dark] .brand-link .pushmenu{ color:hsla(0,0%,100%,.8);background:radial-gradient(#061b29,black);}.main-sidebar .brand-text,.main-sidebar .logo-xl,.main-sidebar .logo-xs,.sidebar .nav-link p,.sidebar .user-panel .info{ transition:margin-left .3s linear,opacity .3s ease,visibility .3s ease;color:#d3d3d3;}.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active,.sidebar-light-primary .nav-sidebar>.nav-item>.nav-link.active{ color:#fff;background:radial-gradient(#1b4b61,#fd030300);border-radius:50px;}.dark-mode .card{ background-color:#00000000;color:#ffffff99;border-width:3px;border-color:#f7f7f7;border-style:double;border-radius:15px;}.btn-info{ color:#ffffff;background-color:#b8171700;border-color:#ffffff;box-shadow:none;}.btn-warning{ color:#ffffff;background-color:#ffc10700;border-color:#ffffff;box-shadow:none;}.card-title{ float:left;font-size:1.1rem;font-weight:400;margin:0;color:white;}.dark-mode .text-muted{ color:#ffffff99!important;}.dark-mode .list-group-item{ background-color:#343a4000;border-color:#ffffff99;}.dark-mode .info-box{ background-color:#343a4000;color:#fff;border:3px;border-style:double;border-radius:15px;border-color:white;}label:not(.form-check-label):not(.custom-file-label){ font-weight:700;color:#ffffffc2;}.dark-mode .custom-control-label:before,.dark-mode .custom-file-label,.dark-mode .custom-file-label:after,.dark-mode .custom-select,.dark-mode .form-control,.dark-mode .input-group-text{ background-color:#007af400;color:#828282;}.alert-success{ color:#fff;background-color:#28a745;border-color:#ffffff;border-radius:15px;border-style:double;}.dark-mode{ color:#fff;background:radial-gradient(#061b29,black);}.dark-mode .invoice{ background-color:#343a4000;border:3px;border-radius:15px;border-color:white;border:double;}.dark-mode .nav-tabs .nav-item.show .nav-link,.dark-mode .nav-tabs .nav-link.active{ background-color:#ffffff1c;color:#fff;}.slim-crop-area img,.slim-image-editor img,.slim-popover img,.slim img{ background:black;}.dark-mode .callout{ background-color:#00ff0333;}.callout.callout-info{ border-left-color:#00e11d;}.p-3{ padding:1rem!important;background:#061b29;}.small-box>.small-box-footer{ color:hsla(0,0%,100%,.8);display:block;padding:3px 0;position:relative;text-align:center;text-decoration:none;z-index:10;background:#061b29;}.dark-mode .dropdown-menu{ background-color:#061b29;border-color:white;}.card-header:first-child{ border-radius:14px 14px 0px 0px;background:#061b29;}.card-body{ flex:1 1 auto;min-height:1px;padding:1.25rem;background:#061b29;}.justify-content-between{ justify-content:space-between!important;background:#061b29;}.dark-mode .card .card-footer{ background-color:#061b29;border-radius:0px 0px 14px 14px;}.dark-mode .select2-selection--single{ background-color:#061b29;border-color:#6c757d;}.select2-search--dropdown{ display:block;padding:4px;background:#061b29;}.select2-container--default .select2-results__option{ padding:6px 12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:blue;background:#061b29;}.dark-mode .select2-dropdown,.dark-mode .select2-dropdown .select2-search__field,.dark-mode .select2-search--inline .select2-search__field{ background-color:#061b29;border-color:#ffffff;color:#fff;}.modal-header{ background:#061b29;}.modal-body{ position:relative;flex:1 1 auto;padding:1rem;background:#061b29;}.dark-mode .modal-footer,.dark-mode .modal-header{ border-color:#ffffff;background:#061b29;}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -8,9 +8,7 @@ use App\Classes\Settings\System;
use App\Http\Controllers\Admin\ActivityLogController;
use App\Http\Controllers\Admin\ApplicationApiController;
use App\Http\Controllers\Admin\InvoiceController;
use App\Http\Controllers\Admin\LegalController;
use App\Http\Controllers\Admin\OverViewController;
use App\Http\Controllers\Admin\PartnerController;
use App\Http\Controllers\Admin\PaymentController;
use App\Http\Controllers\Admin\ProductController;
use App\Http\Controllers\Admin\ServerController as AdminServerController;
@ -21,9 +19,9 @@ use App\Http\Controllers\Admin\UserController;
use App\Http\Controllers\Admin\VoucherController;
use App\Http\Controllers\Auth\SocialiteController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\Moderation\TicketCategoryController;
use App\Http\Controllers\Moderation\TicketsController as ModTicketsController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\PartnerController;
use App\Http\Controllers\ProductController as FrontProductController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\ServerController;
@ -113,15 +111,13 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply');
Route::post('ticket/status/{ticket_id}', [TicketsController::class, 'changeStatus'])->name('ticket.changeStatus');
Route::post('ticket/close/{ticket_id}', [TicketsController::class, 'close'])->name('ticket.close');
}
//admin
Route::prefix('admin')->name('admin.')->middleware('admin')->group(function () {
//overview
Route::get('legal', [OverViewController::class, 'index'])->name('overview.index');
Route::get('overview', [OverViewController::class, 'index'])->name('overview.index');
Route::get('overview/sync', [OverViewController::class, 'syncPterodactyl'])->name('overview.sync');
@ -182,10 +178,6 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable');
Route::resource('usefullinks', UsefulLinkController::class);
//legal
Route::get('legal', [LegalController::class, 'index'])->name('legal.index');
Route::patch('legal', [LegalController::class, 'update'])->name('legal.update');
//vouchers
Route::get('vouchers/datatable', [VoucherController::class, 'datatable'])->name('vouchers.datatable');
Route::get('vouchers/{voucher}/usersdatatable', [VoucherController::class, 'usersdatatable'])->name('vouchers.usersdatatable');
@ -211,7 +203,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::get('ticket/datatable', [ModTicketsController::class, 'datatable'])->name('ticket.datatable');
Route::get('ticket/show/{ticket_id}', [ModTicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [ModTicketsController::class, 'reply'])->name('ticket.reply');
Route::post('ticket/status/{ticket_id}', [ModTicketsController::class, 'changeStatus'])->name('ticket.changeStatus');
Route::post('ticket/close/{ticket_id}', [ModTicketsController::class, 'close'])->name('ticket.close');
Route::post('ticket/delete/{ticket_id}', [ModTicketsController::class, 'delete'])->name('ticket.delete');
//ticket moderation blacklist
Route::get('ticket/blacklist', [ModTicketsController::class, 'blacklist'])->name('ticket.blacklist');
@ -219,11 +211,6 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::post('ticket/blacklist/delete/{id}', [ModTicketsController::class, 'blacklistDelete'])->name('ticket.blacklist.delete');
Route::post('ticket/blacklist/change/{id}', [ModTicketsController::class, 'blacklistChange'])->name('ticket.blacklist.change');
Route::get('ticket/blacklist/datatable', [ModTicketsController::class, 'dataTableBlacklist'])->name('ticket.blacklist.datatable');
Route::get('ticket/category/datatable', [TicketCategoryController::class, 'datatable'])->name('ticket.category.datatable');
Route::resource("ticket/category", TicketCategoryController::class,['as' => 'ticket']);
});
Route::get('/home', [HomeController::class, 'index'])->name('home');

View file

@ -1,66 +0,0 @@
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="icon"
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? \Illuminate\Support\Facades\Storage::disk('public')->url('favicon.ico') : asset('favicon.ico') }}"
type="image/x-icon">
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<link rel="preload" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}" as="style"
onload="this.onload=null;this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}">
</noscript>
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
{!! htmlScriptTagJsApi() !!}
@endif
<link rel="stylesheet" href="{{ asset('themes/BlueInfinity/app.css') }}">
</head>
@yield('content')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.14.1/dist/sweetalert2.all.min.js"></script>
<script>
@if (Session::has('error'))
Swal.fire({
icon: 'error',
title: 'Oops...',
html: '{{ Session::get('error') }}',
})
@endif
@if (Session::has('success'))
Swal.fire({
icon: 'success',
title: '{{ Session::get('success') }}',
position: 'top-end',
showConfirmButton: false,
background: '#343a40',
toast: true,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
@endif
</script>
</html>

View file

@ -1,544 +0,0 @@
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="icon"
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}"
type="image/x-icon">
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
{{-- <link rel="stylesheet" href="{{asset('css/adminlte.min.css')}}"> --}}
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.24/datatables.min.css" />
{{-- summernote --}}
<link rel="stylesheet" href="{{ asset('plugins/summernote/summernote-bs4.min.css') }}">
{{-- datetimepicker --}}
<link rel="stylesheet"
href="{{ asset('plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css') }}">
{{-- select2 --}}
<link rel="stylesheet" href="{{ asset('plugins/select2/css/select2.min.css') }}">
<link rel="preload" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}" as="style"
onload="this.onload=null;this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}">
</noscript>
<script src="{{ asset('js/app.js') }}"></script>
<!-- tinymce -->
<script src={{ asset('plugins/tinymce/js/tinymce/tinymce.min.js') }}></script>
<link rel="stylesheet" href="{{ asset('themes/BlueInfinity/app.css') }}">
</head>
<body class="sidebar-mini layout-fixed dark-mode" style="height: auto;">
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header sticky-top navbar navbar-expand navbar-dark navbar-light">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i
class="fas fa-bars"></i></a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ route('home') }}" class="nav-link"><i
class="fas fa-home mr-2"></i>{{ __('Home') }}</a>
</li>
@if (config('SETTINGS::DISCORD:INVITE_URL'))
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ config('SETTINGS::DISCORD:INVITE_URL') }}" class="nav-link" target="__blank"><i
class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
</li>
@endif
<!-- Language Selection -->
@if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
<li class="nav-item dropdown">
<a class="nav-link" href="#" id="languageDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="mr-1 d-lg-inline text-gray-600">
<small><i class="fa fa-language mr-2"></i></small>{{ __('Language') }}
</span>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
aria-labelledby="changeLocale">
<form method="post" action="{{ route('changeLocale') }}" class="nav-item text-center">
@csrf
@foreach (explode(',', config('SETTINGS::LOCALE:AVAILABLE')) as $key)
<button class="dropdown-item" name="inputLocale" value="{{ $key }}">
{{ __($key) }}
</button>
@endforeach
</form>
</div>
</li>
<!-- End Language Selection -->
@endif
@foreach($useful_links as $link)
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ $link->link }}" class="nav-link" target="__blank"><i
class="{{$link->icon}}"></i> {{ $link->title }}</a>
</li>
@endforeach
</ul>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Notifications Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="far fa-bell"></i>
@if (Auth::user()->unreadNotifications->count() != 0)
<span
class="badge badge-warning navbar-badge">{{ Auth::user()->unreadNotifications->count() }}</span>
@endif
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<span class="dropdown-item dropdown-header">{{ Auth::user()->unreadNotifications->count() }}
{{ __('Notifications') }}</span>
<div class="dropdown-divider"></div>
@foreach (Auth::user()->unreadNotifications->sortBy('created_at')->take(5) as $notification)
<a href="{{ route('notifications.show', $notification->id) }}" class="dropdown-item">
<span class="d-inline-block text-truncate" style="max-width: 150px;"><i
class="fas fa-envelope mr-2"></i>{{ $notification->data['title'] }}</span>
<span
class="float-right text-muted text-sm">{{ $notification->created_at->longAbsoluteDiffForHumans() }}
ago</span>
</a>
@endforeach
<div class="dropdown-divider"></div>
<a href="{{ route('notifications.index') }}"
class="dropdown-item dropdown-footer">{{ __('See all Notifications') }}</a>
<div class="dropdown-divider"></div>
<a href="{{ route('notifications.readAll') }}"
class="dropdown-item dropdown-footer">{{ __('Mark all as read') }}</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link" href="#" id="userDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="mr-1 d-lg-inline text-gray-600">
<small><i class="fas fa-coins mr-2"></i></small>{{ Auth::user()->credits() }}
</span>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
aria-labelledby="userDropdown">
<a class="dropdown-item" href="{{ route('store.index') }}">
<i class="fas fa-coins fa-sm fa-fw mr-2 text-gray-400"></i>
{{ __('Store') }}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" data-toggle="modal" data-target="#redeemVoucherModal"
href="javascript:void(0)">
<i class="fas fa-money-check-alt fa-sm fa-fw mr-2 text-gray-400"></i>
{{ __('Redeem code') }}
</a>
</div>
</li>
<li class="nav-item dropdown no-arrow">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mr-1 d-lg-inline text-gray-600 small">
{{ Auth::user()->name }}
<img width="28px" height="28px" class="rounded-circle ml-1"
src="{{ Auth::user()->getAvatar() }}">
</span>
</a>
<!-- Dropdown - User Information -->
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
aria-labelledby="userDropdown">
<a class="dropdown-item" href="{{ route('profile.index') }}">
<i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
{{ __('Profile') }}
</a>
{{-- <a class="dropdown-item" href="#"> --}}
{{-- <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i> --}}
{{-- Activity Log --}}
{{-- </a> --}}
@if (session()->get('previousUser'))
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('users.logbackin') }}">
<i class="fas fa-sign-in-alt fa-sm fa-fw mr-2 text-gray-400"></i>
{{ __('Log back in') }}
</a>
@endif
<div class="dropdown-divider"></div>
<form method="post" action="{{ route('logout') }}">
@csrf
<button class="dropdown-item" href="#" data-toggle="modal"
data-target="#logoutModal">
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
{{ __('Logout') }}
</button>
</form>
</div>
</li>
</ul>
</nav>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-open sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="{{ route('home') }}" class="brand-link">
<img width="64" height="64"
src="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('icon.png') ? asset('storage/icon.png') : asset('images/controlpanel_logo.png') }}"
alt="{{ config('app.name', 'Laravel') }} Logo" class="brand-image img-circle"
style="opacity: .8">
<span class="brand-text font-weight-light">{{ config('app.name', 'Ctrlpanel.gg') }}</span>
</a>
<!-- Sidebar -->
<div class="sidebar" style="overflow-y: auto">
<!-- Sidebar Menu -->
<nav class="my-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
data-accordion="false">
<!-- Add icons to the links using the .nav-icon class
with font-awesome or any other icon font library -->
<li class="nav-item">
<a href="{{ route('home') }}"
class="nav-link @if (Request::routeIs('home')) active @endif">
<i class="nav-icon fa fa-home"></i>
<p>{{ __('Dashboard') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('servers.index') }}"
class="nav-link @if (Request::routeIs('servers.*')) active @endif">
<i class="nav-icon fa fa-server"></i>
<p>{{ __('Servers') }}
<span class="badge badge-info right">{{ Auth::user()->servers()->count() }} /
{{ Auth::user()->server_limit }}</span>
</p>
</a>
</li>
@if (env('APP_ENV') == 'local' ||
(config('SETTINGS::PAYMENTS:PAYPAL:SECRET') && config('SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID')) ||
(config('SETTINGS::PAYMENTS:STRIPE:SECRET') &&
config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_SECRET') &&
config('SETTINGS::PAYMENTS:STRIPE:METHODS')))
<li class="nav-item">
<a href="{{ route('store.index') }}"
class="nav-link @if (Request::routeIs('store.*') || Request::routeIs('checkout')) active @endif">
<i class="nav-icon fa fa-coins"></i>
<p>{{ __('Store') }}</p>
</a>
</li>
@endif
@if (config('SETTINGS::TICKET:ENABLED'))
<li class="nav-item">
<a href="{{ route('ticket.index') }}"
class="nav-link @if (Request::routeIs('ticket.*')) active @endif">
<i class="nav-icon fas fas fa-ticket-alt"></i>
<p>{{ __('Support Ticket') }}</p>
</a>
</li>
@endif
@if ((Auth::user()->role == 'admin' || Auth::user()->role == 'moderator') && config('SETTINGS::TICKET:ENABLED'))
<li class="nav-header">{{ __('Moderation') }}</li>
<li class="nav-item">
<a href="{{ route('moderator.ticket.index') }}"
class="nav-link @if (Request::routeIs('moderator.ticket.index')) active @endif">
<i class="nav-icon fas fa-ticket-alt"></i>
<p>{{ __('Ticket List') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('moderator.ticket.blacklist') }}"
class="nav-link @if (Request::routeIs('moderator.ticket.blacklist')) active @endif">
<i class="nav-icon fas fa-user-times"></i>
<p>{{ __('Ticket Blacklist') }}</p>
</a>
</li>
@endif
@if (Auth::user()->role == 'admin')
<li class="nav-header">{{ __('Administration') }}</li>
<li class="nav-item">
<a href="{{ route('admin.overview.index') }}"
class="nav-link @if (Request::routeIs('admin.overview.*')) active @endif">
<i class="nav-icon fa fa-home"></i>
<p>{{ __('Overview') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.settings.index') }}"
class="nav-link @if (Request::routeIs('admin.settings.*')) active @endif">
<i class="nav-icon fas fa-tools"></i>
<p>{{ __('Settings') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.api.index') }}"
class="nav-link @if (Request::routeIs('admin.api.*')) active @endif">
<i class="nav-icon fa fa-gamepad"></i>
<p>{{ __('Application API') }}</p>
</a>
</li>
<li class="nav-header">{{ __('Management') }}</li>
<li class="nav-item">
<a href="{{ route('admin.users.index') }}"
class="nav-link @if (Request::routeIs('admin.users.*')) active @endif">
<i class="nav-icon fas fa-users"></i>
<p>{{ __('Users') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.servers.index') }}"
class="nav-link @if (Request::routeIs('admin.servers.*')) active @endif">
<i class="nav-icon fas fa-server"></i>
<p>{{ __('Servers') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.products.index') }}"
class="nav-link @if (Request::routeIs('admin.products.*')) active @endif">
<i class="nav-icon fas fa-sliders-h"></i>
<p>{{ __('Products') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.store.index') }}"
class="nav-link @if (Request::routeIs('admin.store.*')) active @endif">
<i class="nav-icon fas fa-shopping-basket"></i>
<p>{{ __('Store') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.vouchers.index') }}"
class="nav-link @if (Request::routeIs('admin.vouchers.*')) active @endif">
<i class="nav-icon fas fa-money-check-alt"></i>
<p>{{ __('Vouchers') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.partners.index') }}"
class="nav-link @if (Request::routeIs('admin.partners.*')) active @endif">
<i class="nav-icon fas fa-handshake"></i>
<p>{{ __('Partners') }}</p>
</a>
</li>
{{-- <li class="nav-header">Pterodactyl</li> --}}
{{-- <li class="nav-item"> --}}
{{-- <a href="{{route('admin.nodes.index')}}" --}}
{{-- class="nav-link @if (Request::routeIs('admin.nodes.*')) active @endif"> --}}
{{-- <i class="nav-icon fas fa-sitemap"></i> --}}
{{-- <p>Nodes</p> --}}
{{-- </a> --}}
{{-- </li> --}}
{{-- <li class="nav-item"> --}}
{{-- <a href="{{route('admin.nests.index')}}" --}}
{{-- class="nav-link @if (Request::routeIs('admin.nests.*')) active @endif"> --}}
{{-- <i class="nav-icon fas fa-th-large"></i> --}}
{{-- <p>Nests</p> --}}
{{-- </a> --}}
{{-- </li> --}}
<li class="nav-header">{{ __('Other') }}</li>
<li class="nav-item">
<a href="{{ route('admin.usefullinks.index') }}"
class="nav-link @if (Request::routeIs('admin.usefullinks.*')) active @endif">
<i class="nav-icon fas fa-link"></i>
<p>{{ __('Useful Links') }}</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.legal.index') }}"
class="nav-link @if (Request::routeIs('admin.legal.*')) active @endif">
<i class="nav-icon fas fa-link"></i>
<p>{{ __('Legal Sites') }}</p>
</a>
</li>
<li class="nav-header">{{ __('Logs') }}</li>
<li class="nav-item">
<a href="{{ route('admin.payments.index') }}"
class="nav-link @if (Request::routeIs('admin.payments.*')) active @endif">
<i class="nav-icon fas fa-money-bill-wave"></i>
<p>{{ __('Payments') }}
<span
class="badge badge-success right">{{ \App\Models\Payment::count() }}</span>
</p>
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.activitylogs.index') }}"
class="nav-link @if (Request::routeIs('admin.activitylogs.*')) active @endif">
<i class="nav-icon fas fa-clipboard-list"></i>
<p>{{ __('Activity Logs') }}</p>
</a>
</li>
@endif
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
@if (!Auth::user()->hasVerifiedEmail())
@if (Auth::user()->created_at->diffInHours(now(), false) > 1)
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i> {{ __('Warning!') }}</h5>
{{ __('You have not yet verified your email address') }} <a class="text-primary"
href="{{ route('verification.send') }}">{{ __('Click here to resend verification email') }}</a>
<br>
{{ __('Please contact support If you didnt receive your verification email.') }}
</div>
@endif
@endif
@yield('content')
@include('models.redeem_voucher_modal')
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<strong>Copyright &copy; 2021-{{ date('Y') }} <a
href="{{ url('/') }}">{{ env('APP_NAME', 'Laravel') }}</a>.</strong>
All rights
reserved. Powered by <a href="https://ctrlpanel.gg">CtrlPanel</a>. | Theme by <a href="https://2icecube.de/cpgg">2IceCube</a>
@if (!str_contains(config('BRANCHNAME'), 'main') && !str_contains(config('BRANCHNAME'), 'unknown'))
Version <b>{{ config('app')['version'] }} - {{ config('BRANCHNAME') }}</b>
@endif
{{-- Show imprint and privacy link --}}
<div class="float-right d-none d-sm-inline-block">
@if (config('SETTINGS::SYSTEM:SHOW_IMPRINT') == "true")
<a target="_blank" href="{{ route('imprint') }}"><strong>{{ __('Imprint') }}</strong></a> |
@endif
@if (config('SETTINGS::SYSTEM:SHOW_PRIVACY') == "true")
<a target="_blank" href="{{ route('privacy') }}"><strong>{{ __('Privacy') }}</strong></a>
@endif
@if (config('SETTINGS::SYSTEM:SHOW_TOS') == "true")
| <a target="_blank" href="{{ route('tos') }}"><strong>{{ __('Terms of Service') }}</strong></a>
@endif
</div>
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.14.1/dist/sweetalert2.all.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.24/datatables.min.js"></script>
<!-- Summernote -->
<script src="{{ asset('plugins/summernote/summernote-bs4.min.js') }}"></script>
<!-- select2 -->
<script src="{{ asset('plugins/select2/js/select2.min.js') }}"></script>
<!-- Moment.js -->
<script src="{{ asset('plugins/moment/moment.min.js') }}"></script>
<!-- Datetimepicker -->
<script src="{{ asset('plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') }}"></script>
<!-- Select2 -->
<script src={{ asset('plugins/select2/js/select2.min.js') }}></script>
<script>
$(document).ready(function() {
$('[data-toggle="popover"]').popover();
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
});
</script>
<script>
@if (Session::has('error'))
Swal.fire({
icon: 'error',
title: 'Oops...',
html: '{{ Session::get('error') }}',
})
@endif
@if (Session::has('success'))
Swal.fire({
icon: 'success',
title: '{{ Session::get('success') }}',
position: 'top-end',
showConfirmButton: false,
background: '#343a40',
toast: true,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
@endif
@if (Session::has('info'))
Swal.fire({
icon: 'info',
title: '{{ Session::get('info') }}',
position: 'top-end',
showConfirmButton: false,
background: '#343a40',
toast: true,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
@endif
</script>
</body>
</html>

View file

@ -33,7 +33,7 @@
@else
<div class="callout callout-danger">
<h4>{{ __('No recent activity from cronjobs')}}</h4>
<p>{{ __('Are cronjobs running?')}} <a class="text-primary" target="_blank" href="https://ctrlpanel.gg/docs/Installation/getting-started#crontab-configuration">{{ __('Check the docs for it here')}}</a></p>
<p>{{ __('Are cronjobs running?')}} <a class="text-primary" target="_blank" href="https://controlpanel.gg/docs/Installation/getting-started#crontab-configuration">{{ __('Check the docs for it here')}}</a></p>
</div>
@endif

View file

@ -1,113 +0,0 @@
@extends('layouts.main')
@section('content')
<!-- CONTENT HEADER -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{__('Legal')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{route('admin.legal.index')}}">{{__('Legal')}}</a></li>
</ol>
</div>
</div>
</div>
</section>
<!-- END CONTENT HEADER -->
<!-- MAIN CONTENT -->
<section class="content">
<div class="container-fluid">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{ route('admin.legal.update') }}">
@csrf
@method('PATCH')
<div class="row">
<div class="col-md-6">
{{-- TOS --}}
<div class="row mb-2">
<div class="col text-center">
<h1>{{__("Terms of Service")}}</h1>
</div>
</div>
<div class="custom-control mb-3 p-0">
<textarea x-model="tos" id="tos" name="tos"
class="form-control @error('tos') is-invalid @enderror">
{{ $tos }}
</textarea>
@error('motd-message')
<div class="text-danger">
{{ $message }}
</div>
@enderror
</div>
</div>
<div class="col-md-6">
{{-- PRIVACY --}}
<div class="row mb-2">
<div class="col text-center">
<h1>{{__("Privacy Policy")}}</h1>
</div>
</div>
<div class="custom-control mb-3 p-0">
<textarea x-model="privacy" id="privacy" name="privacy"
class="form-control @error('privacy') is-invalid @enderror">
{{ $privacy }}
</textarea>
@error('privacy')
<div class="text-danger">
{{ $message }}
</div>
@enderror
</div>
</div>
<div class="col-md-6">
{{-- Imprint --}}
<div class="row mb-2">
<div class="col text-center">
<h1>{{__("Imprint")}}</h1>
</div>
</div>
<div class="custom-control mb-3 p-0">
<textarea x-model="imprint" id="imprint" name="imprint"
class="form-control @error('imprint') is-invalid @enderror">
{{ $imprint }}
</textarea>
@error('imprint')
<div class="text-danger">
{{ $message }}
</div>
@enderror
</div>
</div>
</div>
<div class="row">
<button class="btn btn-primary ml-3 mt-3">{{ __('Save') }}</button>
</div>
</form>
</div>
<!-- END CUSTOM CONTENT -->
</section>
<!-- END CONTENT -->
<script>tinymce.init({selector:'textarea',promotion: false,skin: "oxide-dark",
content_css: "dark",branding: false, height: 500,
plugins: ['image','link'],});
</script>
@endsection

View file

@ -23,7 +23,7 @@
<b><i class="fas fa-shield-alt"></i> {{__("Version Outdated:")}}</b></br>
{{__("You are running on")}} v{{config("app.version")}}-{{config("BRANCHNAME")}}.
{{__("The latest Version is")}} v{{Storage::get('latestVersion')}}</br>
<a href="https://ctrlpanel.gg/docs/Installation/updating">{{__("Consider updating now")}}</a>
<a href="https://controlpanel.gg/docs/Installation/updating">{{__("Consider updating now")}}</a>
</div>
@endif
</section>
@ -39,16 +39,16 @@
class="fab fa-discord mr-2"></i> {{__('Support server')}}</a>
</div>
<div class="col-md-3">
<a href="https://ctrlpanel.gg/docs/intro" class="btn btn-dark btn-block px-3"><i
<a href="https://controlpanel.gg/docs/intro" class="btn btn-dark btn-block px-3"><i
class="fas fa-link mr-2"></i> {{__('Documentation')}}</a>
</div>
<div class="col-md-3">
<a href="https://github.com/CtrlPanel-gg/panel" class="btn btn-dark btn-block px-3"><i
<a href="https://github.com/ControlPanel-gg/dashboard" class="btn btn-dark btn-block px-3"><i
class="fab fa-github mr-2"></i> {{__('Github')}}</a>
</div>
<div class="col-md-3">
<a href="https://ctrlpanel.gg/docs/Contributing/donating" class="btn btn-dark btn-block px-3"><i
class="fas fa-money-bill mr-2"></i> {{__('Support CtrlPanel')}}</a>
<a href="https://controlpanel.gg/docs/Contributing/donating" class="btn btn-dark btn-block px-3"><i
class="fas fa-money-bill mr-2"></i> {{__('Support ControlPanel')}}</a>
</div>
</div>
@ -199,7 +199,7 @@
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="card-title ">
<span><i class="fas fa-server mr-2"></i>{{__('Ctrlpanel.gg')}}</span>
<span><i class="fas fa-server mr-2"></i>{{__('Controlpanel.gg')}}</span>
</div>
</div>
<div class="card-body py-1">
@ -227,7 +227,7 @@
<p class="mb-2">
{{ __('You reached the Pterodactyl perPage limit. Please make sure to set it higher than your server count.') }}<br>
{{ __('You can do that in settings.') }}<br><br>
{{ __('Note') }}: {{ __('If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on CtrlPanel. Try clicking the button below.') }}
{{ __('Note') }}: {{ __('If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on ControlPanel. Try clicking the button below.') }}
</p>
<a href="{{route('admin.servers.sync')}}" class="btn btn-primary btn-md"><i
class="fas fa-sync mr-2"></i>{{__('Sync servers')}}</a>

View file

@ -6,12 +6,12 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{__('Partner')}}</h1>
<h1>{{__('Vouchers')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a href="{{route('admin.partners.index')}}">{{__('Partner')}}</a>
<li class="breadcrumb-item"><a href="{{route('admin.partners.index')}}">{{__('Vouchers')}}</a>
</li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{route('admin.partners.create')}}">{{__('Create')}}</a>
@ -40,14 +40,19 @@
@csrf
<div class="form-group">
<div class="custom-control mb-3 p-0">
<label for="user_id">{{ __('User') }}:
</label>
<select id="user_id" style="width:100%" class="custom-select" name="user_id" required
autocomplete="off" @error('user_id') is-invalid @enderror>
</select>
<label for="user_id">{{__('User')}}</label>
<select id="user_id" style="width:100%"
class="custom-select @error('user') is-invalid @enderror" name="user_id" autocomplete="off">
@foreach($users as $user)
<option @if($partners->contains('user_id' , $user->id)) disabled @endif
value="{{$user->id}}">{{$user->name}} ({{$user->email}})</option>
@endforeach
</select>
@error('user')
<div class="text-danger">
{{$message}}
</div>
@enderror
</div>
<div class="form-group">
@ -138,75 +143,5 @@
})
</script>
<script type="application/javascript">
function initUserIdSelect(data) {
function escapeHtml(str) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(str));
return div.innerHTML;
}
$('#user_id').select2({
ajax: {
url: '/admin/users.json',
dataType: 'json',
delay: 250,
data: function (params) {
return {
filter: { name: params.term },
page: params.page,
};
},
processResults: function (data, params) {
return { results: data };
},
cache: true,
},
data: data,
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 2,
templateResult: function (data) {
if (data.loading) return escapeHtml(data.text);
return '<div class="user-block"> \
<img class="img-circle img-bordered-xs" src="' + escapeHtml(data.avatarUrl) + '?s=120" alt="User Image"> \
<span class="username"> \
<a href="#">' + escapeHtml(data.name) +'</a> \
</span> \
<span class="description"><strong>' + escapeHtml(data.email) + '</strong>' + '</span> \
</div>';
},
templateSelection: function (data) {
return '<div> \
<span> \
<img class="img-rounded img-bordered-xs" src="' + escapeHtml(data.avatarUrl) + '?s=120" style="height:28px;margin-top:-4px;" alt="User Image"> \
</span> \
<span style="padding-left:5px;"> \
' + escapeHtml(data.name) + ' (<strong>' + escapeHtml(data.email) + '</strong>) \
</span> \
</div>';
}
});
}
$(document).ready(function() {
@if (old('user_id'))
$.ajax({
url: '/admin/users.json?user_id={{ old('user_id') }}',
dataType: 'json',
}).then(function (data) {
initUserIdSelect([ data ]);
});
@else
initUserIdSelect();
@endif
});
</script>
@endsection
@endsection

View file

@ -43,7 +43,7 @@
<div class="form-group">
<label for="identifier">{{ __('Server identifier') }}
<i data-toggle="popover" data-trigger="hover"
data-content="{{ __('Change the server identifier on ctrlpanel to match a pterodactyl server.') }}"
data-content="{{ __('Change the server identifier on controlpanel to match a pterodactyl server.') }}"
class="fas fa-info-circle"></i>
</label>
<input value="{{ $server->identifier }}" id="identifier" name="identifier"
@ -59,7 +59,7 @@
<div class="form-group">
<label for="user_id">{{ __('Server owner') }}
<i data-toggle="popover" data-trigger="hover"
data-content="{{ __('Change the current server owner on ctrlpanel and pterodactyl.') }}"
data-content="{{ __('Change the current server owner on controlpanel and pterodactyl.') }}"
class="fas fa-info-circle"></i>
</label>
<select name="user_id" id="user_id" class="form-control">

View file

@ -1,15 +1,15 @@
<table id="datatable" class="table table-striped">
<thead>
<tr>
<th width="20"></th>
<th>{{ __('Name') }}</th>
<th>{{ __('User') }}</th>
<th>{{ __('Server id') }}</th>
<th>{{ __('Config') }}</th>
<th>{{ __('Suspended at') }}</th>
<th>{{ __('Created at') }}</th>
<th></th>
</tr>
<tr>
<th width="20"></th>
<th>{{__('Name')}}</th>
<th>{{__('User')}}</th>
<th>{{__('Server id')}}</th>
<th>{{__('Config')}}</th>
<th>{{__('Suspended at')}}</th>
<th>{{__('Created at')}}</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
@ -17,53 +17,30 @@
<script>
function submitResult() {
return confirm("{{ __('Are you sure you wish to delete?') }}") !== false;
return confirm("{{__('Are you sure you wish to delete?')}}") !== false;
}
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ config('SETTINGS::LOCALE:DATATABLES') }}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
},
processing: true,
serverSide: true,
stateSave: true,
ajax: "{{ route('admin.servers.datatable') }}{{ $filter ?? '' }}",
order: [
[6, "desc"]
ajax: "{{route('admin.servers.datatable')}}{{$filter ?? ''}}",
order: [[ 5, "desc" ]],
columns: [
{data: 'status' , name : 'servers.suspended'},
{data: 'name'},
{data: 'user' , name : 'user.name'},
{data: 'identifier'},
{data: 'resources' , name : 'product.name'},
{data: 'suspended'},
{data: 'created_at'},
{data: 'actions' , sortable : false},
],
columns: [{
data: 'status',
name: 'servers.suspended',
sortable: false
},
{
data: 'name'
},
{
data: 'user',
name: 'user.name',
},
{
data: 'identifier'
},
{
data: 'resources',
name: 'product.name',
sortable: false
},
{
data: 'suspended'
},
{
data: 'created_at'
},
{
data: 'actions',
sortable: false
},
],
fnDrawCallback: function(oSettings) {
fnDrawCallback: function( oSettings ) {
$('[data-toggle="popover"]').popover();
}
});

View file

@ -20,9 +20,11 @@
<input value="true" id="show-tos" name="show-tos"
{{ config('SETTINGS::SYSTEM:SHOW_TOS') == 'true' ? 'checked' : '' }}
type="checkbox">
<label for="show-tos">{{ __('Show Terms of Service') }} <small><a href="/admin/legal">({{ __('edit content') }})</a></small> </label>
<label for="show-tos">{{ __('Show Terms of Service') }} </label>
</div>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('Show the TOS link in the footer of every page. <br> Edit the content in <b>'.Qirolab\Theme\Theme::path($path = "views").'/information/tos-content.blade.php</b>') }}"
class="fas fa-info-circle"></i>
</div>
</div>
<div class="custom-control mb-1 p-0">
@ -31,9 +33,11 @@
<input value="true" id="show-imprint" name="show-imprint"
{{ config('SETTINGS::SYSTEM:SHOW_IMPRINT') == 'true' ? 'checked' : '' }}
type="checkbox">
<label for="show-imprint">{{ __('Show Imprint') }} <small><a href="/admin/legal">({{ __('edit content') }})</a></small> </label>
<label for="show-imprint">{{ __('Show Imprint') }} </label>
</div>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('Show the imprint link in the footer of every page. <br> Edit the content in <b>'.Qirolab\Theme\Theme::path($path = "views").'/resources/views/information/imprint-content.blade.php</b>') }}"
class="fas fa-info-circle"></i>
</div>
</div>
<div class="custom-control mb-1 p-0">
@ -42,9 +46,11 @@
<input value="true" id="show-privacy" name="show-privacy"
{{ config('SETTINGS::SYSTEM:SHOW_PRIVACY') == 'true' ? 'checked' : '' }}
type="checkbox">
<label for="show-privacy">{{ __('Show Privacy Policy') }} <small><a href="/admin/legal">({{ __('edit content') }})</a></small> </label>
<label for="show-privacy">{{ __('Show Privacy Policy') }} </label>
</div>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('Show the privacy policy link in the footer of every page. <br> Edit the content in <b>'.Qirolab\Theme\Theme::path($path = "views").'/resources/views/information/privacy-content.blade.php</b>') }}"
class="fas fa-info-circle"></i>
</div>
</div>
<div class="custom-control mb-1 p-0">
@ -178,7 +184,7 @@
type="checkbox">
<label for="enable-disable-new-users">{{ __('Creation of new users') }} </label>
<i data-toggle="popover" data-trigger="hover" data-html="true" class="fas fa-info-circle"
data-content="{{ __('Enable the registration of new users on the system.') }}">
data-content="{{ __('If unchecked, it will disable the registration of new users in the system, and this will also apply to the API.') }}">
</i>
</div>
@ -265,7 +271,7 @@
<label for="enable-disable-servers">{{ __('Creation of new servers') }} </label>
</div>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('Enables the creation of new servers for regular users.') }}"
data-content="{{ __('If unchecked, it will disable the creation of new servers for regular users and system moderators, this has no effect for administrators.') }}"
class="fas fa-info-circle"></i>
</div>
</div>
@ -475,7 +481,7 @@
</div>
</form>
</div>
<script>tinymce.init({selector:'textarea',promotion: false,skin: "oxide-dark",
<script>tinymce.init({selector:'textarea',skin: "oxide-dark",
content_css: "dark",branding: false, height: 500,
plugins: ['image','link'],});
</script>

View file

@ -102,12 +102,10 @@
data: 'price'
},
{
data: 'display',
sortable: false
data: 'display'
},
{
data: 'description',
sortable: false
data: 'description'
},
{
data: 'created_at'
@ -123,4 +121,7 @@
});
});
</script>
@endsection

View file

@ -94,23 +94,6 @@
@enderror
</div>
<div class="form-group">
<label for="position">{{__('Position')}}</label>
<select id="position" style="width:100%" class="custom-select" name="position[]"
required multiple autocomplete="off" @error('position') is-invalid @enderror>
@foreach ($positions as $position)
<option id="{{$position->value}}" value="{{ $position->value }}">
{{ __($position->value) }}
</option>
@endforeach
</select>
@error('position')
<div class="text-danger">
{{$message}}
</div>
@enderror
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary">
@ -128,7 +111,6 @@
<!-- END CONTENT -->
<script>
document.addEventListener('DOMContentLoaded', (event) => {
$('.custom-select').select2();
// Summernote
$('#description').summernote({
height: 100,
@ -145,8 +127,6 @@
]
})
})
</script>
@endsection

View file

@ -95,23 +95,6 @@
@enderror
</div>
<div class="form-group">
<label for="position">{{__('Position')}}</label>
<select id="position" style="width:100%" class="custom-select" name="position[]"
required multiple autocomplete="off" @error('position') is-invalid @enderror>
@foreach ($positions as $position)
<option id="{{$position->value}}" value="{{ $position->value }}" @if (strpos($link->position, $position->value) !== false) selected @endif>
{{ __($position->value) }}
</option>
@endforeach
</select>
@error('position')
<div class="text-danger">
{{$message}}
</div>
@enderror
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary">
@ -130,7 +113,6 @@
<script>
document.addEventListener('DOMContentLoaded', (event) => {
$('.custom-select').select2();
// Summernote
$('#description').summernote({
height: 100,

View file

@ -41,7 +41,6 @@
<th width="50">{{__('Icon')}}</th>
<th>{{__('Title')}}</th>
<th>{{__('Link')}}</th>
<th>{{__('Position')}}</th>
<th>{{__('Created at')}}</th>
<th></th>
</tr>
@ -80,7 +79,6 @@
{data: 'icon'},
{data: 'title'},
{data: 'link'},
{data: 'position'},
{data: 'created_at'},
{data: 'actions', sortable: false},
],

View file

@ -6,13 +6,12 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{ __('Users') }}</h1>
<h1>{{__('Users')}}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{ route('admin.users.index') }}">{{ __('Users') }}</a></li>
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.users.index')}}">{{__('Users')}}</a></li>
</ol>
</div>
</div>
@ -28,9 +27,9 @@
<div class="card-header">
<div class="d-flex justify-content-between">
<h5 class="card-title"><i class="fas fa-users mr-2"></i>{{ __('Users') }}</h5>
<a href="{{ route('admin.users.notifications') }}" class="btn btn-sm btn-primary"><i
class="fas fa-paper-plane mr-1"></i>{{ __('Notify') }}</a>
<h5 class="card-title"><i class="fas fa-users mr-2"></i>{{__('Users')}}</h5>
<a href="{{route('admin.users.notifications')}}" class="btn btn-sm btn-primary"><i
class="fas fa-paper-plane mr-1"></i>{{__('Notify')}}</a>
</div>
</div>
@ -38,21 +37,21 @@
<table id="datatable" class="table table-striped">
<thead>
<tr>
<th>discordId</th>
<th>ip</th>
<th>pterodactyl_id</th>
<th>{{ __('Avatar') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Role') }}</th>
<th>{{ __('Email') }}</th>
<th>{{ CREDITS_DISPLAY_NAME }}</th>
<th>{{ __('Servers') }}</th>
<th>{{ __('Referrals') }}</th>
<th>{{ __('Verified') }}</th>
<th>{{ __('Last seen') }}</th>
<th></th>
</tr>
<tr>
<th>discordId</th>
<th>ip</th>
<th>pterodactyl_id</th>
<th>{{__('Avatar')}}</th>
<th>{{__('Name')}}</th>
<th>{{__('Role')}}</th>
<th>{{__('Email')}}</th>
<th>{{CREDITS_DISPLAY_NAME}}</th>
<th>{{__('Servers')}}</th>
<th>{{__("Referrals")}}</th>
<th>{{__('Verified')}}</th>
<th>{{__('Last seen')}}</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
@ -69,76 +68,41 @@
<script>
function submitResult() {
return confirm("{{ __('Are you sure you wish to delete?') }}") !== false;
return confirm("{{__('Are you sure you wish to delete?')}}") !== false;
}
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ config('SETTINGS::LOCALE:DATATABLES') }}.json'
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
},
processing: true,
serverSide: true, //why was this set to false before? increased loadingtimes by 10 seconds
stateSave: true,
ajax: "{{ route('admin.users.datatable') }}{{ $filter ?? '' }}",
order: [
[11, "desc"]
ajax: "{{route('admin.users.datatable')}}",
order: [[ 11, "asc" ]],
columns: [
{data: 'discordId', visible: false, name: 'discordUser.id'},
{data: 'pterodactyl_id', visible: false},
{data: 'ip', visible: false},
{data: 'avatar' , sortable : false},
{data: 'name'},
{data: 'role'},
{data: 'email', name: 'users.email'},
{data: 'credits' , name : 'users.credits'},
{data: 'servers'},
{data: 'referrals'},
{data: 'verified' , sortable : false},
{data: 'last_seen', type: 'num', render: {_: 'display', sort: 'raw'}},
{data: 'actions' , sortable : false},
],
columns: [{
data: 'discordId',
visible: false,
name: 'discordUser.id'
},
{
data: 'pterodactyl_id',
visible: false
},
{
data: 'ip',
visible: false
},
{
data: 'avatar',
sortable: false
},
{
data: 'name'
},
{
data: 'role'
},
{
data: 'email',
name: 'users.email'
},
{
data: 'credits',
name: 'users.credits'
},
{
data: 'servers_count',
searchable: false
},
{
data: 'referrals_count',
searchable: false
},
{
data: 'verified',
sortable: false
},
{
data: 'last_seen',
},
{
data: 'actions',
sortable: false
},
],
fnDrawCallback: function(oSettings) {
fnDrawCallback: function( oSettings ) {
$('[data-toggle="popover"]').popover();
}
});
});
</script>
@endsection

View file

@ -11,7 +11,7 @@
class="mr-1">{{ config('app.name', 'Laravel') }}</b></a>
@if (config('SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO'))
<img src="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}"
alt="{{ config('app.name', 'Ctrlpanel.gg') }} Logo" style="opacity: .8;max-width:100%">
alt="{{ config('app.name', 'Controlpanel.gg') }} Logo" style="opacity: .8;max-width:100%">
@endif
</div>
<div class="card-body">

View file

@ -133,7 +133,7 @@
</div>
<!-- /.card-header -->
<div class="card-body">
@foreach ($useful_links_dashboard as $useful_link)
@foreach ($useful_links as $useful_link)
<div class="alert alert-dismissible">
<button type="button" class="close" data-dismiss="alert"
aria-hidden="true">×</button>

View file

@ -18,7 +18,7 @@
</li>
<li>
<p><strong>Company</strong> (referred to as either &quot;the Company&quot;, &quot;We&quot;, &quot;Us&quot; or
&quot;Our&quot; in this Agreement) refers to ctrlpanel.</p>
&quot;Our&quot; in this Agreement) refers to controlpanel.</p>
</li>
<li>
<p><strong>Cookies</strong> are small files that are placed on Your computer, mobile device or any other device
@ -49,8 +49,8 @@
Service or from the Service infrastructure itself (for example, the duration of a page visit).</p>
</li>
<li>
<p><strong>Website</strong> refers to ctrlpanel, accessible from <a href="ctrlpanel"
rel="external nofollow noopener" target="_blank">ctrlpanel</a></p>
<p><strong>Website</strong> refers to controlpanel, accessible from <a href="controlpanel"
rel="external nofollow noopener" target="_blank">controlpanel</a></p>
</li>
<li>
<p><strong>You</strong> means the individual accessing or using the Service, or the company, or other legal

View file

@ -16,21 +16,24 @@
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? \Illuminate\Support\Facades\Storage::disk('public')->url('favicon.ico') : asset('favicon.ico') }}"
type="image/x-icon">
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link rel="preload" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}" as="style"
onload="this.onload=null;this.rel='stylesheet'">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<noscript>
<link rel="stylesheet" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}">
</noscript>
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
{!! htmlScriptTagJsApi() !!}
@endif
@vite('themes/default/sass/app.scss')
</head>
@yield('content')

View file

@ -14,7 +14,7 @@
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}"
type="image/x-icon">
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
{{-- <link rel="stylesheet" href="{{asset('css/adminlte.min.css')}}"> --}}
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.24/datatables.min.css" />
@ -22,6 +22,8 @@
{{-- summernote --}}
<link rel="stylesheet" href="{{ asset('plugins/summernote/summernote-bs4.min.css') }}">
{{-- datetimepicker --}}
<link rel="stylesheet"
href="{{ asset('plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css') }}">
@ -29,6 +31,7 @@
{{-- select2 --}}
<link rel="stylesheet" href="{{ asset('plugins/select2/css/select2.min.css') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link rel="preload" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}" as="style"
onload="this.onload=null;this.rel='stylesheet'">
<noscript>
@ -37,7 +40,6 @@
<script src="{{ asset('js/app.js') }}"></script>
<!-- tinymce -->
<script src={{ asset('plugins/tinymce/js/tinymce/tinymce.min.js') }}></script>
@vite('themes/default/sass/app.scss')
</head>
<body class="sidebar-mini layout-fixed dark-mode" style="height: auto;">
@ -60,7 +62,6 @@
class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
</li>
@endif
<!-- Language Selection -->
@if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
<li class="nav-item dropdown">
@ -85,12 +86,6 @@
</li>
<!-- End Language Selection -->
@endif
@foreach($useful_links as $link)
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ $link->link }}" class="nav-link" target="__blank"><i
class="{{$link->icon}}"></i> {{ $link->title }}</a>
</li>
@endforeach
</ul>
<!-- Right navbar links -->
@ -199,7 +194,7 @@
src="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('icon.png') ? asset('storage/icon.png') : asset('images/controlpanel_logo.png') }}"
alt="{{ config('app.name', 'Laravel') }} Logo" class="brand-image img-circle"
style="opacity: .8">
<span class="brand-text font-weight-light">{{ config('app.name', 'Ctrlpanel.gg') }}</span>
<span class="brand-text font-weight-light">{{ config('app.name', 'Controlpanel.gg') }}</span>
</a>
<!-- Sidebar -->
@ -379,14 +374,6 @@
</a>
</li>
<li class="nav-item">
<a href="{{ route('admin.legal.index') }}"
class="nav-link @if (Request::routeIs('admin.legal.*')) active @endif">
<i class="nav-icon fas fa-link"></i>
<p>{{ __('Legal Sites') }}</p>
</a>
</li>
<li class="nav-header">{{ __('Logs') }}</li>
<li class="nav-item">
@ -441,8 +428,8 @@
<strong>Copyright &copy; 2021-{{ date('Y') }} <a
href="{{ url('/') }}">{{ env('APP_NAME', 'Laravel') }}</a>.</strong>
All rights
reserved. Powered by <a href="https://ctrlpanel.gg">CtrlPanel</a>.
@if (!str_contains(config('BRANCHNAME'), 'main') && !str_contains(config('BRANCHNAME'), 'unknown'))
reserved. Powered by <a href="https://controlpanel.gg">ControlPanel</a>.
@if (!str_contains(config('BRANCHNAME'), 'main'))
Version <b>{{ config('app')['version'] }} - {{ config('BRANCHNAME') }}</b>
@endif

View file

@ -1,132 +0,0 @@
@extends('layouts.main')
@section('content')
<!-- CONTENT HEADER -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{ __('Ticket Categories') }}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{ route("moderator.ticket.category.index") }}">{{ __('Ticket Categories') }}</a>
</li>
</ol>
</div>
</div>
</div>
</section>
<!-- END CONTENT HEADER -->
<!-- MAIN CONTENT -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between">
<h5 class="card-title"><i class="fas fas fa-users mr-2"></i>{{__('Categories')}}</h5>
</div>
</div>
<div class="card-body table-responsive">
<table id="datatable" class="table table-striped">
<thead>
<tr>
<th>{{__('ID')}}</th>
<th>{{__('Name')}}</th>
<th>{{__('Tickets')}}</th>
<th>{{__('Created At')}}</th>
<th>{{__('Actions')}}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h5 class="card-title">{{__('Add Category')}}
</div>
<div class="card-body">
<form action="{{route("moderator.ticket.category.store")}}" method="POST" class="ticket-form">
@csrf
<div class="form-group ">
<label for="name" class="control-label">{{__("Name")}}</label>
<input id="name" type="text" class="form-control" name="name" required>
</div>
<button type="submit" class="btn btn-primary">
{{__('Submit')}}
</button>
</form>
</div>
</div>
<div class="card">
<div class="card-header">
<h5 class="card-title">{{__('Edit Category')}}
</div>
<div class="card-body">
<form action="{{route("moderator.ticket.category.update","1")}}" method="POST" class="ticket-form">
@csrf
@method('PATCH')
<select id="category" style="width:100%" class="custom-select" name="category"
required autocomplete="off" @error('category') is-invalid @enderror>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ __($category->name) }}</option>
@endforeach
</select>
<div class="form-group ">
<label for="name" class="control-label">{{__("New Name")}}</label>
<input id="name" type="text" class="form-control" name="name" required>
</div>
<button type="submit" class="btn btn-primary">
{{__('Submit')}}
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- END CONTENT -->
<script>
document.addEventListener("DOMContentLoaded", function () {
$('#datatable').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("SETTINGS::LOCALE:DATATABLES")}}.json'
},
processing: true,
serverSide: true,
stateSave: true,
ajax: "{{route('moderator.ticket.category.datatable')}}",
columns: [
{data: 'id'},
{data: 'name'},
{data: 'tickets'},
{data: 'created_at', sortable: false},
{data: 'actions', sortable: false},
],
fnDrawCallback: function( oSettings ) {
$('[data-toggle="popover"]').popover();
}
});
});
document.addEventListener('DOMContentLoaded', (event) => {
$('.custom-select').select2();
})
</script>
@endsection

View file

@ -30,11 +30,8 @@
<div class="d-flex justify-content-between">
<h5 class="card-title"><i class="fas fa-ticket-alt mr-2"></i>{{__('Ticket List')}}</h5>
</div>
<a href="{{route("moderator.ticket.category.index")}}"><button class="btn btn-primary float-right">+ {{__("Add Category")}}</button></a>
</div>
<div class="card-body table-responsive">
<table id="datatable" class="table table-striped">

View file

@ -35,64 +35,29 @@
<div class="card-body">
<div class="ticket-info">
@if(!empty($server))
<p><b>{{__("Server")}}:</b> <a href="{{ config("SETTINGS::SYSTEM:PTERODACTYL:URL") . '/admin/servers/view/' . $server->pterodactyl_id }}" target="__blank">{{ $server->name }}</a></p>
<p><b>Server:</b> <a href="{{ config("SETTINGS::SYSTEM:PTERODACTYL:URL") . '/admin/servers/view/' . $server->pterodactyl_id }}" target="__blank">{{ $server->name }}</a></p>
@endif
<p><b>{{__("Title")}}:</b> {{ $ticket->title }}</p>
<p><b>{{__("Category")}}:</b> {{ $ticketcategory->name }}</p>
<p><b>{{__("Status")}}:</b>
@switch($ticket->status)
@case("Open")
<span class="badge badge-success">{{__("Open")}}</span>
@break
@case("Reopened")
<span class="badge badge-success">{{__("Reopened")}}</span>
@break
@case("Closed")
<span class="badge badge-danger">{{__("Closed")}}</span>
@break
@case("Answered")
<span class="badge badge-info">{{__("Answered")}}</span>
@break
@case("Client Reply")
<span class="badge badge-warning">{{__("Client Reply")}}</span>
@break
@endswitch
</p>
<p><b>Priority:</b>
@switch($ticket->priority)
@case("Low")
<span class="badge badge-success">{{__("Low")}}</span>
@break
@case("Medium")
<span class="badge badge-warning">{{__("Medium")}}</span>
@break
@case("High")
<span class="badge badge-danger">{{__("High")}}</span>
@break
@endswitch
</p>
<p><b>{{__("Created on")}}:</b> {{ $ticket->created_at->diffForHumans() }}</p>
@if($ticket->status=='Closed')
<form class="d-inline" method="post"
action="{{route('moderator.ticket.changeStatus', ['ticket_id' => $ticket->ticket_id ])}}">
{{csrf_field()}}
{{method_field("POST") }}
<button data-content="{{__("Reopen")}}" data-toggle="popover"
data-trigger="hover" data-placement="top"
class="btn btn-sm text-white btn-success mr-1"><i
class="fas fa-redo"></i>{{__("Reopen")}}</button>
</form>
@else
<form class="d-inline" method="post"
action="{{route('moderator.ticket.changeStatus', ['ticket_id' => $ticket->ticket_id ])}}">
{{csrf_field()}}
{{method_field("POST") }}
<button data-content="{{__("Close")}}" data-toggle="popover"
data-trigger="hover" data-placement="top"
class="btn btn-sm text-white btn-warning mr-1"><i
class="fas fa-times"></i>{{__("Close")}}</button>
</form>
<p><b>Title:</b> {{ $ticket->title }}</p>
<p><b>Category:</b> {{ $ticketcategory->name }}</p>
<p>
@if ($ticket->status === 'Open')
<b>Status:</b> <span class="badge badge-success">Open</span>
@elseif ($ticket->status === 'Closed')
<b>Status:</b> <span class="badge badge-danger">Closed</span>
@elseif ($ticket->status === 'Answered')
<b>Status:</b> <span class="badge badge-info">Answered</span>
@elseif ($ticket->status === 'Client Reply')
<b>Status:</b> <span class="badge badge-warning">Client Reply</span>
@endif
</p>
<p><b>Created on:</b> {{ $ticket->created_at->diffForHumans() }}</p>
@if($ticket->status!='Closed')
<form class="d-inline" method="post" action="{{route('moderator.ticket.close', ['ticket_id' => $ticket->ticket_id ])}}">
{{csrf_field()}}
{{method_field("POST") }}
<button data-content="{{__("Close")}}" data-toggle="popover" data-trigger="hover" data-placement="top" class="btn btn-sm text-white btn-warning mr-1"><i class="fas fa-times"></i>{{__("Close")}}</button>
</form>
@endif
</div>
</div>
</div>

View file

@ -212,7 +212,7 @@
{{ __('Required') }} {{ CREDITS_DISPLAY_NAME }}
{{ __('to create this server') }}</span>
<span class="d-inline-block"
x-text="product.minimum_credits == -1 ? {{ config('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER') }} : product.minimum_credits"></span>
x-text="product.minimum_credits === -1 ? {{ config('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER') }} : product.minimum_credit"></span>
</li>
</ul>
</div>

View file

@ -77,25 +77,21 @@
<div class="row">
<!-- accepted payments column -->
<div class="col-6">
@if (!$productIsFree)
<p class="lead">{{ __('Payment Methods') }}:</p>
<p class="lead">{{ __('Payment Methods') }}:</p>
<div class="d-flex flex-wrap flex-direction-row">
@foreach ($paymentGateways as $gateway)
<div class="ml-2">
<label class="text-center" for="{{ $gateway->name }}">
<img class="mb-3" height="50"
src="{{ $gateway->image }}"></br>
<input x-on:click="console.log(payment_method)"
x-model="payment_method" type="radio"
id="{{ $gateway->name }}" value="{{ $gateway->name }}">
</input>
</label>
</div>
@endforeach
</div>
@endif
<div class="d-flex flex-wrap flex-direction-row">
@foreach ($paymentGateways as $gateway)
<div class="ml-2">
<label class="text-center" for="{{ $gateway->name }}">
<img class="mb-3" height="50" src="{{ $gateway->image }}"></br>
<input x-on:click="console.log(payment_method)" x-model="payment_method"
type="radio" id="{{ $gateway->name }}"
value="{{ $gateway->name }}">
</input>
</label>
</div>
@endforeach
</div>
</div>
<!-- /.col -->
@ -133,15 +129,11 @@
<!-- this row will not appear when printing -->
<div class="row no-print">
<div class="col-12">
<button :disabled="(!payment_method || clicked) && {{ !$productIsFree }}"
:class="(!payment_method || clicked) && {{ !$productIsFree }} ? 'disabled' : ''"
<button :disabled="!payment_method || clicked"
:class="!payment_method || clicked ? 'disabled' : ''"
class="btn btn-success float-right"><i class="far fa-credit-card mr-2"
@click="clicked = true"></i>
@if ($productIsFree)
{{ __('Get for free') }}
@else
{{ __('Submit Payment') }}
@endif
{{ __('Submit Payment') }}
</button>
</div>
</div>

View file

@ -46,14 +46,14 @@
</div>
@if ($servers->count() >= 1)
<div class="form-group col-sm-12 {{ $errors->has('server') ? ' has-error' : '' }}">
<label for="server" class="control-label">{{__("Server")}}</label>
<label for="server" class="control-label">Servers</label>
<select id="server" type="server" class="form-control" name="server">
<option value="">{{__("Select Servers")}}</option>
<option value="">Select Servers</option>
@foreach ($servers as $server)
<option value="{{ $server->id }}">{{ $server->name }}</option>
@endforeach
</select>
@if ($errors->has('category'))
<span class="help-block">
<strong>{{ $errors->first('ticketcategory') }}</strong>
@ -62,14 +62,14 @@
</div>
@endif
<div class="form-group col-sm-12 {{ $errors->has('ticketcategory') ? ' has-error' : '' }}">
<label for="ticketcategory" class="control-label">{{__("Category")}}</label>
<select id="ticketcategory" type="ticketcategory" class="form-control" required name="ticketcategory">
<option value="" disabled selected>{{__("Select Category")}}</option>
<label for="ticketcategory" class="control-label">Category</label>
<select id="ticketcategory" type="ticketcategory" class="form-control" name="ticketcategory">
<option value="">Select Category</option>
@foreach ($ticketcategories as $ticketcategory)
<option value="{{ $ticketcategory->id }}">{{ $ticketcategory->name }}</option>
@endforeach
</select>
@if ($errors->has('category'))
<span class="help-block">
<strong>{{ $errors->first('ticketcategory') }}</strong>
@ -79,10 +79,10 @@
<div class="form-group col-sm-12 {{ $errors->has('priority') ? ' has-error' : '' }}">
<label for="priority" class="control-label">Priority</label>
<select id="priority" type="" class="form-control" name="priority">
<option value="" disabled selected>{{__("Select Priority")}}</option>
<option value="Low">{{__("Low")}}</option>
<option value="Medium">{{__("Medium")}}</option>
<option value="High">{{__("High")}}</option>
<option value="">Select Priority</option>
<option value="Low">Low</option>
<option value="Medium">Medium</option>
<option value="High">High</option>
</select>
@if ($errors->has('priority'))
<span class="help-block">
@ -108,7 +108,7 @@
<div class="card-body">
<div class="form-group col-sm-12 {{ $errors->has('message') ? ' has-error' : '' }}">
<label for="message" class="control-label">Message</label>
<textarea rows="8" id="message" class="form-control" name="message">{{old("message")}}</textarea>
<textarea rows="8" id="message" class="form-control" name="message"></textarea>
@if ($errors->has('message'))
<span class="help-block">
<strong>{{ $errors->first('message') }}</strong>
@ -124,12 +124,12 @@
</section>
<!-- END CONTENT -->
<script type="text/javascript">
$(".ticket-form").submit(function (e) {
$(".ticket-once").attr("disabled", true);
$(".ticket-form").submit(function (e) {
$(".ticket-once").attr("disabled", true);
return true;
})
</script>
@endsection

View file

@ -86,13 +86,12 @@
serverSide: true,
stateSave: true,
ajax: "{{route('ticket.datatable')}}",
order: [[ 4, "desc" ]],
columns: [
{data: 'category'},
{data: 'title'},
{data: 'priority'},
{data: 'status'},
{data: 'updated_at', type: 'num', render: {_: 'display', sort: 'raw'}},
{data: 'updated_at', sortable: false},
{data: 'actions', sortable: false},
],
fnDrawCallback: function( oSettings ) {

View file

@ -35,58 +35,25 @@
<div class="card-body">
<div class="ticket-info">
@if(!empty($server))
<p><b>{{__("Server")}}:</b> <a
href="{{ config('SETTINGS::SYSTEM:PTERODACTYL:URL') }}/server/{{ $server->identifier }}"
target="__blank">{{ $server->name }} </a></p>
<p><b>Server:</b> <a href="{{ config('SETTINGS::SYSTEM:PTERODACTYL:URL') }}/server/{{ $server->identifier }}" target="__blank">{{ $server->name }} </a></p>
@endif
<p><b>{{__("Title")}}:</b> {{ $ticket->title }}</p>
<p><b>{{__("Category")}}:</b> {{ $ticketcategory->name }}</p>
<p><b>{{__("Status")}}:</b>
@switch($ticket->status)
@case("Open")
<span class="badge badge-success">{{__("Open")}}</span>
@break
@case("Reopened")
<span class="badge badge-success">{{__("Reopened")}}</span>
@break
@case("Closed")
<span class="badge badge-danger">{{__("Closed")}}</span>
@break
@case("Answered")
<span class="badge badge-info">{{__("Answered")}}</span>
@break
@case("Client Reply")
<span class="badge badge-warning">{{__("Client Reply")}}</span>
@break
@endswitch
<p><b>Title:</b> {{ $ticket->title }}</p>
<p><b>Category:</b> {{ $ticketcategory->name }}</p>
<p>
@if ($ticket->status === 'Open')
<b>Status:</b> <span class="badge badge-success">Open</span>
@elseif ($ticket->status === 'Closed')
<b>Status:</b> <span class="badge badge-danger">Closed</span>
@elseif ($ticket->status === 'Answered')
<b>Status:</b> <span class="badge badge-info">Answered</span>
@elseif ($ticket->status === 'Client Reply')
<b>Status:</b> <span class="badge badge-warning">Client Reply</span>
@endif
</p>
<p><b>Priority:</b>
@switch($ticket->priority)
@case("Low")
<span class="badge badge-success">{{__("Low")}}</span>
@break
@case("Medium")
<span class="badge badge-warning">{{__("Medium")}}</span>
@break
@case("High")
<span class="badge badge-danger">{{__("High")}}</span>
@break
@endswitch
</p>
<p><b>{{__("Created on")}}:</b> {{ $ticket->created_at->diffForHumans() }}</p>
@if($ticket->status=='Closed')
<p><b>Created on:</b> {{ $ticket->created_at->diffForHumans() }}</p>
@if($ticket->status!='Closed')
<form class="d-inline" method="post"
action="{{route('ticket.changeStatus', ['ticket_id' => $ticket->ticket_id ])}}">
{{csrf_field()}}
{{method_field("POST") }}
<button data-content="{{__("Reopen")}}" data-toggle="popover"
data-trigger="hover" data-placement="top"
class="btn btn-sm text-white btn-success mr-1"><i
class="fas fa-redo"></i>{{__("Reopen")}}</button>
</form>
@else
<form class="d-inline" method="post"
action="{{route('ticket.changeStatus', ['ticket_id' => $ticket->ticket_id ])}}">
action="{{route('ticket.close', ['ticket_id' => $ticket->ticket_id ])}}">
{{csrf_field()}}
{{method_field("POST") }}
<button data-content="{{__("Close")}}" data-toggle="popover"
@ -111,60 +78,56 @@
<div class="card-header">
<div class="d-flex justify-content-between">
<h5 class="card-title"><img
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticket->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticket->user->id}}">{{ $ticket->user->name }} </a>
@if($ticket->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticket->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticket->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticket->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@endif
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticket->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticket->user->id}}">{{ $ticket->user->name }} </a>
@if($ticket->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticket->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticket->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticket->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@endif
</h5>
<span
class="badge badge-primary">{{ $ticket->created_at->diffForHumans() }}</span>
<span class="badge badge-primary">{{ $ticket->created_at->diffForHumans() }}</span>
</div>
</div>
<div class="card-body" style="white-space:pre-wrap">{{ $ticket->message }}</div>
</div>
@foreach ($ticketcomments as $ticketcomment)
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between">
<h5 class="card-title"><img
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticketcomment->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticketcomment->user->id}}">{{ $ticketcomment->user->name }}</a>
@if($ticketcomment->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticketcomment->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticketcomment->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticketcomment->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@endif
</h5>
<span
class="badge badge-primary">{{ $ticketcomment->created_at->diffForHumans() }}</span>
</div>
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between">
<h5 class="card-title"><img
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticketcomment->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticketcomment->user->id}}">{{ $ticketcomment->user->name }}</a>
@if($ticketcomment->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticketcomment->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticketcomment->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticketcomment->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@endif
</h5>
<span class="badge badge-primary">{{ $ticketcomment->created_at->diffForHumans() }}</span>
</div>
<div class="card-body"
style="white-space:pre-wrap">{{ $ticketcomment->ticketcomment }}</div>
</div>
<div class="card-body" style="white-space:pre-wrap">{{ $ticketcomment->ticketcomment }}</div>
</div>
@endforeach
<div class="comment-form">
<form action="{{ route('ticket.reply')}}" method="POST" class="form reply-form">
{!! csrf_field() !!}
<input type="hidden" name="ticket_id" value="{{ $ticket->id }}">
<div class="form-group{{ $errors->has('ticketcomment') ? ' has-error' : '' }}">
<textarea rows="10" id="ticketcomment" class="form-control"
name="ticketcomment"></textarea>
<textarea rows="10" id="ticketcomment" class="form-control" name="ticketcomment"></textarea>
@if ($errors->has('ticketcomment'))
<span class="help-block">
<span class="help-block">
<strong>{{ $errors->first('ticketcomment') }}</strong>
</span>
@endif
@ -182,12 +145,12 @@
</section>
<!-- END CONTENT -->
<script type="text/javascript">
$(".reply-form").submit(function (e) {
$(".reply-once").attr("disabled", true);
$(".reply-form").submit(function (e) {
$(".reply-once").attr("disabled", true);
return true;
})
</script>
@endsection

View file

@ -11,7 +11,7 @@ export default defineConfig({
"themes/default/sass/app.scss",
"themes/default/js/app.js"
],
buildDirectory: "build",
buildDirectory: "default",
}),

16
webpack.mix.js vendored Normal file
View file

@ -0,0 +1,16 @@
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.sourceMaps();