ctrlpanel/routes/web.php

169 lines
9.1 KiB
PHP
Raw Normal View History

2021-06-05 09:26:32 +00:00
<?php
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;
2021-06-05 09:26:32 +00:00
use App\Http\Controllers\Admin\ActivityLogController;
use App\Http\Controllers\Admin\ApplicationApiController;
2022-01-04 08:05:53 +00:00
use App\Http\Controllers\Admin\InvoiceController;
use App\Http\Controllers\Admin\OverViewController;
2021-06-05 09:26:32 +00:00
use App\Http\Controllers\Admin\PaymentController;
2022-05-30 09:07:10 +00:00
use App\Http\Controllers\Admin\ShopProductController;
2021-06-05 09:26:32 +00:00
use App\Http\Controllers\Admin\ProductController;
use App\Http\Controllers\Admin\ServerController as AdminServerController;
use App\Http\Controllers\Admin\SettingsController;
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;
2021-12-16 10:06:54 +00:00
use App\Http\Controllers\TranslationController;
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;
use App\Classes\Settings\Language;
use App\Classes\Settings\Invoices;
use App\Classes\Settings\System;
2021-06-05 09:26:32 +00:00
/*
|--------------------------------------------------------------------------
| 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]);
2021-12-16 17:03:38 +00:00
# Stripe WebhookRoute -> validation in Route Handler
Route::post('payment/StripeWebhooks', [PaymentController::class, 'StripeWebhooks'])->name('payment.StripeWebhooks');
2021-09-26 15:50:13 +00:00
Route::middleware(['auth', 'checkSuspended'])->group(function () {
2021-06-12 11:59:48 +00:00
#resend verification email
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');
2021-06-05 09:26:32 +00:00
#normal routes
2022-06-02 06:44:54 +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);
Route::resource('servers', ServerController::class);
Route::resource('profile', ProfileController::class);
Route::resource('store', StoreController::class);
2021-11-06 00:56:57 +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');
Route::get('/products/products/{egg?}/{node?}', [FrontProductController::class, 'getProductsBasedOnNode'])->name('products.products.node');
2021-11-06 00:56:57 +00:00
2021-06-05 09:26:32 +00:00
#payments
2022-05-30 09:07:10 +00:00
Route::get('checkout/{shopProduct}', [PaymentController::class, 'checkOut'])->name('checkout');
Route::get('payment/PaypalPay/{shopProduct}', [PaymentController::class, 'PaypalPay'])->name('payment.PaypalPay');
Route::get('payment/PaypalSuccess', [PaymentController::class, 'PaypalSuccess'])->name('payment.PaypalSuccess');
2022-05-30 09:07:10 +00:00
Route::get('payment/StripePay/{shopProduct}', [PaymentController::class, 'StripePay'])->name('payment.StripePay');
Route::get('payment/StripeSuccess', [PaymentController::class, 'StripeSuccess'])->name('payment.StripeSuccess');
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');
#discord
Route::get('/auth/redirect', [SocialiteController::class, 'redirect'])->name('auth.redirect');
Route::get('/auth/callback', [SocialiteController::class, 'callback'])->name('auth.callback');
2021-07-10 06:58:11 +00:00
#voucher redeem
Route::post('/voucher/redeem', [VoucherController::class, 'redeem'])->middleware('throttle:5,1')->name('voucher.redeem');
2021-07-10 06:58:11 +00:00
2021-12-16 10:06:54 +00:00
#switch language
Route::post('changelocale', [TranslationController::class, 'changeLocale'])->name('changeLocale');
2021-06-05 09:26:32 +00:00
#admin
Route::prefix('admin')->name('admin.')->middleware('admin')->group(function () {
#overview
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-06-05 09:26:32 +00:00
Route::resource('activitylogs', ActivityLogController::class);
#users
2021-08-04 20:01:50 +00:00
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');
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);
#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');
Route::resource('servers', AdminServerController::class);
#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);
#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
]);
#payments
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');
#settings
Route::get('settings/datatable', [SettingsController::class, 'datatable'])->name('settings.datatable');
Route::patch('settings/updatevalue', [SettingsController::class, 'updatevalue'])->name('settings.updatevalue');
2021-06-05 09:26:32 +00:00
#settings
Route::patch('settings/update/invoice-settings', [Invoices::class, 'updateSettings'])->name('settings.update.invoicesettings');
Route::patch('settings/update/language', [Language::class, 'updateSettings'])->name('settings.update.languagesettings');
Route::patch('settings/update/payment', [Payments::class, 'updateSettings'])->name('settings.update.paymentsettings');
Route::patch('settings/update/misc', [Misc::class, 'updateSettings'])->name('settings.update.miscsettings');
Route::patch('settings/update/system', [System::class, 'updateSettings'])->name('settings.update.systemsettings');
2021-06-05 09:26:32 +00:00
Route::resource('settings', SettingsController::class)->only('index');
2022-01-04 08:05:53 +00:00
#invoices
Route::get('invoices/download-invoices', [InvoiceController::class, 'downloadAllInvoices'])->name('invoices.downloadAllInvoices');;
Route::get('invoices/download-single-invoice', [InvoiceController::class, 'downloadSingleInvoice'])->name('invoices.downloadSingleInvoice');;
#usefullinks
Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable');
Route::resource('usefullinks', UsefulLinkController::class);
#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);
#api-keys
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
});
Route::get('/home', [HomeController::class, 'index'])->name('home');
});