2021-06-05 09:26:32 +00:00
|
|
|
<?php
|
|
|
|
|
2023-01-02 14:00:57 +00:00
|
|
|
use App\Classes\Settings\Invoices;
|
|
|
|
use App\Classes\Settings\Language;
|
2022-01-07 09:16:33 +00:00
|
|
|
use App\Classes\Settings\Misc;
|
2022-01-07 08:54:01 +00:00
|
|
|
use App\Classes\Settings\Payments;
|
2023-01-02 14:00:57 +00:00
|
|
|
use App\Classes\Settings\System;
|
2021-06-05 09:26:32 +00:00
|
|
|
use App\Http\Controllers\Admin\ActivityLogController;
|
2021-06-06 18:22:40 +00:00
|
|
|
use App\Http\Controllers\Admin\ApplicationApiController;
|
2022-01-04 08:05:53 +00:00
|
|
|
use App\Http\Controllers\Admin\InvoiceController;
|
2023-01-29 22:15:35 +00:00
|
|
|
use App\Http\Controllers\Admin\LegalController;
|
2021-11-07 00:47:16 +00:00
|
|
|
use App\Http\Controllers\Admin\OverViewController;
|
2023-01-31 09:38:43 +00:00
|
|
|
use App\Http\Controllers\Admin\PartnerController;
|
2021-06-05 09:26:32 +00:00
|
|
|
use App\Http\Controllers\Admin\PaymentController;
|
|
|
|
use App\Http\Controllers\Admin\ProductController;
|
2023-04-30 00:22:59 +00:00
|
|
|
use App\Http\Controllers\Admin\RoleController;
|
2021-06-05 09:26:32 +00:00
|
|
|
use App\Http\Controllers\Admin\ServerController as AdminServerController;
|
2022-01-14 09:19:41 +00:00
|
|
|
use App\Http\Controllers\Admin\SettingsController;
|
2023-01-02 14:00:57 +00:00
|
|
|
use App\Http\Controllers\Admin\ShopProductController;
|
2023-05-04 23:11:55 +00:00
|
|
|
use App\Http\Controllers\Admin\TicketCategoryController;
|
|
|
|
use App\Http\Controllers\Admin\TicketsController as AdminTicketsController;
|
2021-06-10 21:25:13 +00:00
|
|
|
use App\Http\Controllers\Admin\UsefulLinkController;
|
2021-06-05 09:26:32 +00:00
|
|
|
use App\Http\Controllers\Admin\UserController;
|
2021-07-09 22:18:22 +00:00
|
|
|
use App\Http\Controllers\Admin\VoucherController;
|
2021-06-05 09:26:32 +00:00
|
|
|
use App\Http\Controllers\Auth\SocialiteController;
|
|
|
|
use App\Http\Controllers\HomeController;
|
|
|
|
use App\Http\Controllers\NotificationController;
|
2021-11-06 00:56:57 +00:00
|
|
|
use App\Http\Controllers\ProductController as FrontProductController;
|
2021-06-05 09:26:32 +00:00
|
|
|
use App\Http\Controllers\ProfileController;
|
|
|
|
use App\Http\Controllers\ServerController;
|
|
|
|
use App\Http\Controllers\StoreController;
|
2022-08-01 16:52:16 +00:00
|
|
|
use App\Http\Controllers\TicketsController;
|
2023-01-02 14:00:57 +00:00
|
|
|
use App\Http\Controllers\TranslationController;
|
2021-07-10 07:41:24 +00:00
|
|
|
use Illuminate\Http\Request;
|
2021-06-12 11:59:48 +00:00
|
|
|
use Illuminate\Support\Facades\Auth;
|
2021-06-05 09:26:32 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Web Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
Route::middleware('guest')->get('/', function () {
|
|
|
|
return redirect('login');
|
|
|
|
})->name('welcome');
|
|
|
|
|
|
|
|
Auth::routes(['verify' => true]);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
Route::get('/privacy', function () {
|
2023-01-15 00:40:25 +00:00
|
|
|
return view('information.privacy');
|
2023-01-05 17:01:42 +00:00
|
|
|
})->name('privacy');
|
|
|
|
Route::get('/imprint', function () {
|
2023-01-15 00:40:25 +00:00
|
|
|
return view('information.imprint');
|
2023-01-05 17:01:42 +00:00
|
|
|
})->name('imprint');
|
|
|
|
Route::get('/tos', function () {
|
2023-01-15 00:40:25 +00:00
|
|
|
return view('information.tos');
|
2023-01-05 17:01:42 +00:00
|
|
|
})->name('tos');
|
2022-12-22 21:30:09 +00:00
|
|
|
|
2021-09-26 15:50:13 +00:00
|
|
|
Route::middleware(['auth', 'checkSuspended'])->group(function () {
|
2023-01-05 17:01:42 +00:00
|
|
|
//resend verification email
|
2021-06-12 11:59:48 +00:00
|
|
|
Route::get('/email/verification-notification', function (Request $request) {
|
|
|
|
$request->user()->sendEmailVerificationNotification();
|
|
|
|
|
|
|
|
return back()->with('success', 'Verification link sent!');
|
|
|
|
})->middleware(['auth', 'throttle:3,1'])->name('verification.send');
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//normal routes
|
2023-01-02 14:00:57 +00:00
|
|
|
Route::get('notifications/readAll', [NotificationController::class, 'readAll'])->name('notifications.readAll');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::resource('notifications', NotificationController::class);
|
2022-07-22 01:52:49 +00:00
|
|
|
Route::patch('/servers/cancel/{server}', [ServerController::class, 'cancel'])->name('servers.cancel');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::resource('servers', ServerController::class);
|
2023-05-08 09:55:17 +00:00
|
|
|
|
2023-05-08 19:16:06 +00:00
|
|
|
if (config('app.key')) {
|
|
|
|
$serverSettings = app(App\Settings\ServerSettings::class);
|
|
|
|
if ($serverSettings->enable_upgrade) {
|
|
|
|
Route::post('servers/{server}/upgrade', [ServerController::class, 'upgrade'])->name('servers.upgrade');
|
|
|
|
}
|
2022-08-16 20:33:59 +00:00
|
|
|
}
|
2023-01-02 14:00:57 +00:00
|
|
|
|
|
|
|
Route::post('profile/selfdestruct', [ProfileController::class, 'selfDestroyUser'])->name('profile.selfDestroyUser');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::resource('profile', ProfileController::class);
|
|
|
|
Route::resource('store', StoreController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//server create utility routes (product)
|
|
|
|
//routes made for server create page to fetch product info
|
2021-11-07 11:07:30 +00:00
|
|
|
Route::get('/products/nodes/egg/{egg?}', [FrontProductController::class, 'getNodesBasedOnEgg'])->name('products.nodes.egg');
|
2021-11-07 15:29:18 +00:00
|
|
|
Route::get('/products/locations/egg/{egg?}', [FrontProductController::class, 'getLocationsBasedOnEgg'])->name('products.locations.egg');
|
2021-11-11 21:05:42 +00:00
|
|
|
Route::get('/products/products/{egg?}/{node?}', [FrontProductController::class, 'getProductsBasedOnNode'])->name('products.products.node');
|
2021-11-06 00:56:57 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//payments
|
2022-05-30 09:07:10 +00:00
|
|
|
Route::get('checkout/{shopProduct}', [PaymentController::class, 'checkOut'])->name('checkout');
|
2023-01-03 20:17:25 +00:00
|
|
|
Route::post('payment/pay', [PaymentController::class, 'pay'])->name('payment.pay');
|
2023-01-04 17:59:52 +00:00
|
|
|
Route::get('payment/FreePay/{shopProduct}', [PaymentController::class, 'FreePay'])->name('payment.FreePay');
|
2021-12-14 01:17:19 +00:00
|
|
|
Route::get('payment/Cancel', [PaymentController::class, 'Cancel'])->name('payment.Cancel');
|
|
|
|
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('users/logbackin', [UserController::class, 'logBackIn'])->name('users.logbackin');
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//discord
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('/auth/redirect', [SocialiteController::class, 'redirect'])->name('auth.redirect');
|
|
|
|
Route::get('/auth/callback', [SocialiteController::class, 'callback'])->name('auth.callback');
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//voucher redeem
|
2021-07-10 07:41:24 +00:00
|
|
|
Route::post('/voucher/redeem', [VoucherController::class, 'redeem'])->middleware('throttle:5,1')->name('voucher.redeem');
|
2021-07-10 06:58:11 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//switch language
|
2021-12-16 10:06:54 +00:00
|
|
|
Route::post('changelocale', [TranslationController::class, 'changeLocale'])->name('changeLocale');
|
2022-08-02 15:37:59 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//ticket user
|
2023-02-05 17:20:55 +00:00
|
|
|
Route::get('ticket', [TicketsController::class, 'index'])->name('ticket.index');
|
|
|
|
Route::get('ticket/datatable', [TicketsController::class, 'datatable'])->name('ticket.datatable');
|
|
|
|
Route::get('ticket/new', [TicketsController::class, 'create'])->name('ticket.new');
|
|
|
|
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');
|
2023-05-03 14:16:50 +00:00
|
|
|
Route::post('ticket/status/{ticket_id}', [TicketsController::class, 'changeStatus'])->name('ticket.changeStatus');
|
2023-02-09 23:04:00 +00:00
|
|
|
|
2022-01-02 18:37:31 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//admin
|
2023-05-04 23:11:55 +00:00
|
|
|
Route::prefix('admin')->name('admin.')->group(function () {
|
2023-04-30 00:22:59 +00:00
|
|
|
//Roles
|
|
|
|
Route::get('roles/datatable', [RoleController::class, 'datatable'])->name('roles.datatable');
|
|
|
|
Route::resource('roles', RoleController::class);
|
2023-01-05 17:01:42 +00:00
|
|
|
//overview
|
2023-01-29 22:15:35 +00:00
|
|
|
Route::get('legal', [OverViewController::class, 'index'])->name('overview.index');
|
|
|
|
|
2021-11-07 11:07:30 +00:00
|
|
|
Route::get('overview', [OverViewController::class, 'index'])->name('overview.index');
|
|
|
|
Route::get('overview/sync', [OverViewController::class, 'syncPterodactyl'])->name('overview.sync');
|
2021-11-07 00:47:16 +00:00
|
|
|
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::resource('activitylogs', ActivityLogController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//users
|
|
|
|
Route::get('users.json', [UserController::class, 'json'])->name('users.json');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('users/loginas/{user}', [UserController::class, 'loginAs'])->name('users.loginas');
|
2022-08-10 18:11:02 +00:00
|
|
|
Route::get('users/verifyEmail/{user}', [UserController::class, 'verifyEmail'])->name('users.verifyEmail');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('users/datatable', [UserController::class, 'datatable'])->name('users.datatable');
|
2021-08-04 20:01:50 +00:00
|
|
|
Route::get('users/notifications', [UserController::class, 'notifications'])->name('users.notifications');
|
|
|
|
Route::post('users/notifications', [UserController::class, 'notify'])->name('users.notifications');
|
2021-09-26 15:50:13 +00:00
|
|
|
Route::post('users/togglesuspend/{user}', [UserController::class, 'toggleSuspended'])->name('users.togglesuspend');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::resource('users', UserController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//servers
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('servers/datatable', [AdminServerController::class, 'datatable'])->name('servers.datatable');
|
|
|
|
Route::post('servers/togglesuspend/{server}', [AdminServerController::class, 'toggleSuspended'])->name('servers.togglesuspend');
|
2022-07-22 01:52:49 +00:00
|
|
|
Route::patch('/servers/cancel/{server}', [AdminServerController::class, 'cancel'])->name('servers.cancel');
|
2022-10-21 19:12:07 +00:00
|
|
|
Route::get('servers/sync', [AdminServerController::class, 'syncServers'])->name('servers.sync');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::resource('servers', AdminServerController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//products
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('products/datatable', [ProductController::class, 'datatable'])->name('products.datatable');
|
2021-07-06 21:19:25 +00:00
|
|
|
Route::get('products/clone/{product}', [ProductController::class, 'clone'])->name('products.clone');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::patch('products/disable/{product}', [ProductController::class, 'disable'])->name('products.disable');
|
|
|
|
Route::resource('products', ProductController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//store
|
2022-05-30 09:07:10 +00:00
|
|
|
Route::get('store/datatable', [ShopProductController::class, 'datatable'])->name('store.datatable');
|
|
|
|
Route::patch('store/disable/{shopProduct}', [ShopProductController::class, 'disable'])->name('store.disable');
|
|
|
|
Route::resource('store', ShopProductController::class)->parameters([
|
|
|
|
'store' => 'shopProduct',
|
2021-06-05 09:26:32 +00:00
|
|
|
]);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//payments
|
2021-06-23 09:28:57 +00:00
|
|
|
Route::get('payments/datatable', [PaymentController::class, 'datatable'])->name('payments.datatable');
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('payments', [PaymentController::class, 'index'])->name('payments.index');
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//settings
|
2022-01-05 07:57:41 +00:00
|
|
|
Route::get('settings/datatable', [SettingsController::class, 'datatable'])->name('settings.datatable');
|
|
|
|
Route::patch('settings/updatevalue', [SettingsController::class, 'updatevalue'])->name('settings.updatevalue');
|
2023-01-05 17:01:42 +00:00
|
|
|
Route::get('settings/checkPteroClientkey', [System::class, 'checkPteroClientkey'])->name('settings.checkPteroClientkey');
|
|
|
|
Route::redirect('settings#system', 'system')->name('settings.system');
|
2022-11-04 19:15:48 +00:00
|
|
|
|
2023-02-09 23:04:00 +00:00
|
|
|
Route::get('settings', [SettingsController::class, 'index'])->name('settings.index');
|
|
|
|
Route::post('settings', [SettingsController::class, 'update'])->name('settings.update');
|
2021-06-06 18:22:40 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//invoices
|
2023-01-02 14:00:57 +00:00
|
|
|
Route::get('invoices/download-invoices', [InvoiceController::class, 'downloadAllInvoices'])->name('invoices.downloadAllInvoices');
|
2022-08-12 11:30:15 +00:00
|
|
|
Route::get('invoices/download-single-invoice', [InvoiceController::class, 'downloadSingleInvoice'])->name('invoices.downloadSingleInvoice');
|
2022-01-04 08:05:53 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//usefullinks
|
2021-06-10 21:25:13 +00:00
|
|
|
Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable');
|
|
|
|
Route::resource('usefullinks', UsefulLinkController::class);
|
|
|
|
|
2023-01-29 22:15:35 +00:00
|
|
|
//legal
|
|
|
|
Route::get('legal', [LegalController::class, 'index'])->name('legal.index');
|
|
|
|
Route::patch('legal', [LegalController::class, 'update'])->name('legal.update');
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//vouchers
|
2021-07-09 22:18:22 +00:00
|
|
|
Route::get('vouchers/datatable', [VoucherController::class, 'datatable'])->name('vouchers.datatable');
|
2021-10-02 22:55:10 +00:00
|
|
|
Route::get('vouchers/{voucher}/usersdatatable', [VoucherController::class, 'usersdatatable'])->name('vouchers.usersdatatable');
|
|
|
|
Route::get('vouchers/{voucher}/users', [VoucherController::class, 'users'])->name('vouchers.users');
|
2021-07-09 22:18:22 +00:00
|
|
|
Route::resource('vouchers', VoucherController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//partners
|
2022-08-27 16:59:07 +00:00
|
|
|
Route::get('partners/datatable', [PartnerController::class, 'datatable'])->name('partners.datatable');
|
|
|
|
Route::get('partners/{voucher}/users', [PartnerController::class, 'users'])->name('partners.users');
|
|
|
|
Route::resource('partners', PartnerController::class);
|
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//api-keys
|
2021-06-06 18:22:40 +00:00
|
|
|
Route::get('api/datatable', [ApplicationApiController::class, 'datatable'])->name('api.datatable');
|
|
|
|
Route::resource('api', ApplicationApiController::class)->parameters([
|
|
|
|
'api' => 'applicationApi',
|
|
|
|
]);
|
2021-06-05 09:26:32 +00:00
|
|
|
|
2023-01-05 17:01:42 +00:00
|
|
|
//ticket moderation
|
2023-05-04 23:11:55 +00:00
|
|
|
Route::get('ticket', [AdminTicketsController::class, 'index'])->name('ticket.index');
|
|
|
|
Route::get('ticket/datatable', [AdminTicketsController::class, 'datatable'])->name('ticket.datatable');
|
|
|
|
Route::get('ticket/show/{ticket_id}', [AdminTicketsController::class, 'show'])->name('ticket.show');
|
|
|
|
Route::post('ticket/reply', [AdminTicketsController::class, 'reply'])->name('ticket.reply');
|
|
|
|
Route::post('ticket/status/{ticket_id}', [AdminTicketsController::class, 'changeStatus'])->name('ticket.changeStatus');
|
|
|
|
Route::post('ticket/delete/{ticket_id}', [AdminTicketsController::class, 'delete'])->name('ticket.delete');
|
2023-01-05 17:01:42 +00:00
|
|
|
//ticket moderation blacklist
|
2023-05-04 23:11:55 +00:00
|
|
|
Route::get('ticket/blacklist', [AdminTicketsController::class, 'blacklist'])->name('ticket.blacklist');
|
|
|
|
Route::post('ticket/blacklist', [AdminTicketsController::class, 'blacklistAdd'])->name('ticket.blacklist.add');
|
|
|
|
Route::post('ticket/blacklist/delete/{id}', [AdminTicketsController::class, 'blacklistDelete'])->name('ticket.blacklist.delete');
|
|
|
|
Route::post('ticket/blacklist/change/{id}', [AdminTicketsController::class, 'blacklistChange'])->name('ticket.blacklist.change');
|
|
|
|
Route::get('ticket/blacklist/datatable', [AdminTicketsController::class, 'dataTableBlacklist'])->name('ticket.blacklist.datatable');
|
2023-02-01 10:07:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
Route::get('ticket/category/datatable', [TicketCategoryController::class, 'datatable'])->name('ticket.category.datatable');
|
2023-02-09 23:04:00 +00:00
|
|
|
Route::resource("ticket/category", TicketCategoryController::class, ['as' => 'ticket']);
|
2022-08-01 16:52:16 +00:00
|
|
|
});
|
2022-08-02 15:37:59 +00:00
|
|
|
|
2023-05-04 23:11:55 +00:00
|
|
|
|
|
|
|
|
2021-06-05 09:26:32 +00:00
|
|
|
Route::get('/home', [HomeController::class, 'index'])->name('home');
|
2023-01-02 12:46:21 +00:00
|
|
|
});
|
2023-01-03 17:31:21 +00:00
|
|
|
|
2023-01-18 17:05:32 +00:00
|
|
|
require __DIR__ . '/extensions_web.php';
|