name file |
size |
edit |
permission |
action |
.editorconfig | 258 KB | August 13 2024 21:03:02 | 0770 |
|
.env | 1340 KB | November 09 2024 13:13:00 | 0770 |
|
.env.example | 1213 KB | August 13 2024 21:03:02 | 0770 |
|
.gitattributes | 186 KB | August 13 2024 21:03:02 | 0770 |
|
.htaccess | 466 KB | August 13 2024 21:03:02 | 0770 |
|
.well-known | - | July 10 2025 23:46:46 | 0750 |
|
11.php | 70548 KB | July 01 2025 20:07:37 | 0644 |
|
Modules | - | November 04 2024 11:42:06 | 0755 |
|
README.md | 80 KB | August 13 2024 21:03:02 | 0770 |
|
app | - | November 04 2024 11:42:06 | 0755 |
|
artisan | 1686 KB | August 13 2024 21:03:02 | 0770 |
|
aws.php | 188721 KB | July 12 2025 06:01:05 | 0644 |
|
bootstrap | - | November 04 2024 11:38:26 | 0777 |
|
composer.json | 2932 KB | September 19 2024 12:33:02 | 0770 |
|
composer.lock | 415525 KB | September 19 2024 12:33:02 | 0770 |
|
config | - | July 02 2025 03:17:17 | 0777 |
|
database | - | November 04 2024 11:42:06 | 0777 |
|
index.php | 13824 KB | July 02 2025 01:57:55 | 0770 |
|
ktq.txt | 1 KB | July 02 2025 01:58:01 | 0644 |
|
lang | - | November 04 2024 11:38:26 | 0777 |
|
main.php | 302 KB | July 05 2025 04:22:24 | 0644 |
|
modules_statuses.json | 775 KB | August 26 2024 12:34:26 | 0770 |
|
package-lock.json | 72682 KB | November 09 2024 12:47:51 | 0770 |
|
package.json | 481 KB | August 13 2024 21:03:02 | 0770 |
|
phpunit.xml | 1084 KB | August 13 2024 21:03:02 | 0770 |
|
postcss.config.js | 93 KB | August 13 2024 21:03:02 | 0770 |
|
public | - | July 12 2025 06:01:05 | 0777 |
|
resources | - | November 04 2024 11:42:07 | 0755 |
|
robots.txt | 986 KB | July 18 2025 17:04:57 | 0644 |
|
routes | - | November 04 2024 11:38:26 | 0777 |
|
server.php | 541 KB | August 13 2024 21:03:04 | 0770 |
|
ss.php | 17569 KB | July 02 2025 03:06:06 | 0644 |
|
storage | - | November 04 2024 11:42:08 | 0755 |
|
tailwind.config.js | 541 KB | August 13 2024 21:03:04 | 0770 |
|
tests | - | November 04 2024 11:42:08 | 0777 |
|
tmp.zip | 3878 KB | July 12 2025 06:01:05 | 0644 |
|
vendor | - | November 04 2024 11:42:12 | 0777 |
|
version.json | 26 KB | October 15 2024 18:29:32 | 0770 |
|
vite-module-loader.js | 1397 KB | August 13 2024 21:03:06 | 0770 |
|
vite.config.js | 310 KB | August 13 2024 21:03:06 | 0770 |
|
getClientOriginalExtension();
$file_name = 'wsus-img' . date('-Y-m-d-h-i-s-') . rand(999, 9999) . '.' . $extention;
$file_name = $path . $file_name;
$file->move(public_path($path), $file_name);
try {
if ($oldFile && !str($oldFile)->contains('uploads/website-images') && File::exists(public_path($oldFile))) {
File::delete(public_path($oldFile));
}
if ($optimize) {
ImageOptimizer::optimize(public_path($file_name));
}
} catch (Exception $e) {
Log::info($e->getMessage());
}
return $file_name;
}
// file upload method
if (!function_exists('allLanguages')) {
function allLanguages() {
$allLanguages = Cache::rememberForever('allLanguages', function () {
return Language::select('code', 'name', 'direction', 'status')->get();
});
if (!$allLanguages) {
$allLanguages = Language::select('code', 'name', 'direction', 'status')->get();
}
return $allLanguages;
}
}
if (!function_exists('allCurrencies')) {
function allCurrencies() {
$allCurrencies = Cache::rememberForever('allCurrencies', function () {
return MultiCurrency::all();
});
if (!$allCurrencies) {
$allCurrencies = MultiCurrency::all();
}
return $allCurrencies;
}
}
if (!function_exists('getSessionLanguage')) {
function getSessionLanguage(): string {
if (!session()->has('lang')) {
session()->put('lang', config('app.locale'));
session()->forget('text_direction');
session()->put('text_direction', 'ltr');
}
$lang = Session::get('lang');
return $lang;
}
}
if (!function_exists('getSessionCurrency')) {
function getSessionCurrency(): string {
if (!session()->has('currency_code') || !session()->has('currency_rate') || !session()->has('currency_position')) {
$currency = allCurrencies()->where('is_default', 'yes')->first();
session()->put('currency_code', $currency->currency_code);
session()->forget('currency_position');
session()->put('currency_position', $currency->currency_position);
session()->forget('currency_icon');
session()->put('currency_icon', $currency->currency_icon);
session()->forget('currency_rate');
session()->put('currency_rate', $currency->currency_rate);
}
return Session::get('currency_code');
}
}
function admin_lang() {
return Session::get('admin_lang');
}
if (!function_exists('getSocialLinks')) {
function getSocialLinks() {
return Cache::rememberForever('getSocialLinks', function () {
return \Modules\SocialLink\app\Models\SocialLink::select('link', 'icon')->get();
});
}
}
// calculate currency
function currency($price) {
getSessionCurrency();
$currency_icon = Session::get('currency_icon');
$currency_rate = Session::has('currency_rate') ? Session::get('currency_rate') : 1;
$currency_position = Session::get('currency_position');
$price = $price * $currency_rate;
$price = number_format($price, 2, '.', ',');
if ($currency_position == 'before_price') {
$price = $currency_icon . $price;
} elseif ($currency_position == 'before_price_with_space') {
$price = $currency_icon . ' ' . $price;
} elseif ($currency_position == 'after_price') {
$price = $price . $currency_icon;
} elseif ($currency_position == 'after_price_with_space') {
$price = $price . ' ' . $currency_icon;
} else {
$price = $currency_icon . $price;
}
return $price;
}
// calculate currency
if (!function_exists('userAuth')) {
function userAuth() {
return Auth::guard('web')->user();
}
}
if (!function_exists('adminAuth')) {
function adminAuth() {
return Auth::guard('admin')->user();
}
}
if (!function_exists('getPayableAmount')) {
function getPayableAmount() {
}
}
function payable_with_charges($amount): ?array {
$availablePaymentMethods = [
'stripe',
'paypal',
'razorpay',
'mollie',
'instamojo',
'flutterwave',
'paystack',
'bank',
];
getSessionCurrency();
$currency_rate = Session::has('currency_rate') ? Session::get('currency_rate') : 1;
$getGlobalInformationClass = new class
{
use GetGlobalInformationTrait;
};
$payable_with_charges = [];
foreach ($availablePaymentMethods as $paymentMethod) {
if ($paymentMethod == 'stripe' || $paymentMethod == 'paypal' || $paymentMethod == 'bank') {
$basic_payment = $getGlobalInformationClass->get_basic_payment_info();
$charge_property = $paymentMethod . '_charge';
$gateway_charge = property_exists($basic_payment, $charge_property) ? $basic_payment->$charge_property : 0;
} else {
$payment_setting = $getGlobalInformationClass->get_payment_gateway_info();
$charge_property = $paymentMethod . '_charge';
$gateway_charge = property_exists($payment_setting, $charge_property) ? $payment_setting->$charge_property : 0;
}
$payable_amount = $amount * $currency_rate;
$gateway_charge = $payable_amount * ($gateway_charge / 100);
$payable_with_charge = $payable_amount + $gateway_charge;
$payable_with_charges[$paymentMethod] = number_format(sprintf('%0.2f', $payable_with_charge));
}
return $payable_with_charges;
}
// custom decode and encode input value
function html_decode($text) {
$after_decode = htmlspecialchars_decode($text, ENT_QUOTES);
return $after_decode;
}
if (!function_exists('checkAdminHasPermission')) {
function checkAdminHasPermission($permission): bool {
return Auth::guard('admin')->user()->can($permission) ? true : false;
}
}
if (!function_exists('checkAdminHasPermissionAndThrowException')) {
function checkAdminHasPermissionAndThrowException($permission) {
if (!checkAdminHasPermission($permission)) {
throw new AccessPermissionDeniedException();
}
}
}
if (!function_exists('getSettingStatus')) {
function getSettingStatus($key) {
if (Cache::has('setting')) {
$setting = Cache::get('setting');
if (!is_null($key)) {
return $setting->$key == 'active' ? true : false;
}
} else {
try {
return Setting::where('key', $key)->first()?->value == 'active' ? true : false;
} catch (Exception $e) {
if (app()->isLocal()) {
Log::info($e->getMessage());
}
return false;
}
}
return false;
}
}
if (!function_exists('checkCrentials')) {
function checkCrentials() {
if (Cache::has('setting') && $settings = Cache::get('setting')) {
if ($settings->recaptcha_status !== 'inactive' && ($settings->recaptcha_site_key == 'recaptcha_site_key' || $settings->recaptcha_secret_key == 'recaptcha_secret_key' || $settings->recaptcha_site_key == '' || $settings->recaptcha_secret_key == '')) {
return (object) [
'status' => true,
'message' => __('Google Recaptcha credentails not found'),
'description' => __('This may create a problem while submitting any form submission from website. Please fill up the credential from google account.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->pixel_status !== 'inactive' && ($settings->pixel_app_id == 'pixel_app_id' || $settings->pixel_app_id == '')) {
return (object) [
'status' => true,
'message' => __('Facebook Pixel credentails not found'),
'description' => __('This may create a problem to analyze your website. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->facebook_login_status !== 'inactive' && ($settings->facebook_app_id == 'facebook_app_id' || $settings->facebook_app_secret == 'facebook_app_secret' || $settings->facebook_redirect_url == 'facebook_redirect_url' || $settings->facebook_app_id == '' || $settings->facebook_app_secret == '' || $settings->facebook_redirect_url == '')) {
return (object) [
'status' => true,
'message' => __('Facebook login credentails not found'),
'description' => __('This may create a problem while logging in using facebook. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->google_login_status !== 'inactive' && ($settings->gmail_client_id == 'gmail_client_id' || $settings->gmail_secret_id == 'gmail_secret_id' || $settings->gmail_client_id == '' || $settings->gmail_secret_id == '')) {
return (object) [
'status' => true,
'message' => __('Google login credentails not found'),
'description' => __('This may create a problem while logging in using google. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->google_tagmanager_status !== 'inactive' && ($settings->google_tagmanager_id == 'google_tagmanager_id' || $settings->google_tagmanager_id == '')) {
return (object) [
'status' => true,
'message' => __('Google tag manager credentials not found'),
'description' => __('This may create a problem to analyze your website. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->google_analytic_status !== 'inactive' && ($settings->google_analytic_id == 'google_analytic_id' || $settings->google_analytic_id == '')) {
return (object) [
'status' => true,
'message' => __('Google analytic credentials not found'),
'description' => __('This may create a problem to analyze your website. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->tawk_status !== 'inactive' && ($settings->tawk_chat_link == 'tawk_chat_link' || $settings->tawk_chat_link == '')) {
return (object) [
'status' => true,
'message' => __('Tawk Chat Link credentails not found'),
'description' => __('This may create a problem to analyze your website. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->pusher_status !== 'inactive' && ($settings->pusher_app_id == 'pusher_app_id' || $settings->pusher_app_key == 'pusher_app_key' || $settings->pusher_app_secret == 'pusher_app_secret' || $settings->pusher_app_cluster == 'pusher_app_cluster' || $settings->pusher_app_id == '' || $settings->pusher_app_key == '' || $settings->pusher_app_secret == '' || $settings->pusher_app_cluster == '')) {
return (object) [
'status' => true,
'message' => __('Pusher credentails not found'),
'description' => __('This may create a problem while logging in using google. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->mail_host == 'mail_host' || $settings->mail_username == 'mail_username' || $settings->mail_password == 'mail_password' || $settings->mail_host == '' || $settings->mail_port == '' || $settings->mail_username == '' || $settings->mail_password == '') {
return (object) [
'status' => true,
'message' => __('Mail credentails not found'),
'description' => __('This may create a problem while sending email. Please fill up the credential to avoid any problem.'),
'route' => 'admin.email-configuration',
];
}
if ($settings->wasabi_status !== 'inactive' && ($settings->wasabi_access_id == 'wasabi_access_id' || $settings->wasabi_access_id == '' || $settings->wasabi_secret_key == 'wasabi_secret_key' || $settings->wasabi_secret_key == '' || $settings->wasabi_bucket == 'wasabi_secret_key' || $settings->wasabi_bucket == '' || $settings->wasabi_region == 'wasabi_region' || $settings->wasabi_region == '')) {
return (object) [
'status' => true,
'message' => __('Wasabi cloud storage credentials not found'),
'description' => __('This may create a problem to analyze your website. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
if ($settings->aws_status !== 'inactive' && ($settings->aws_access_id == 'aws_access_id' || $settings->aws_access_id == '' || $settings->aws_secret_key == 'aws_secret_key' || $settings->aws_secret_key == '' || $settings->aws_bucket == 'aws_secret_key' || $settings->aws_bucket == '' || $settings->aws_region == 'aws_region' || $settings->aws_region == '')) {
return (object) [
'status' => true,
'message' => __('AWS cloud storage credentials not found'),
'description' => __('This may create a problem to analyze your website. Please fill up the credential to avoid any problem.'),
'route' => 'admin.crediential-setting',
];
}
}
if (!Cache::has('basic_payment') && Module::isEnabled('BasicPayment')) {
Cache::rememberForever('basic_payment', function () {
$payment_info = BasicPayment::get();
$basic_payment = [];
foreach ($payment_info as $payment_item) {
$basic_payment[$payment_item->key] = $payment_item->value;
}
return (object) $basic_payment;
});
}
if (Cache::has('basic_payment') && $basicPayment = Cache::get('basic_payment')) {
if ($basicPayment->stripe_status !== 'inactive' && ($basicPayment->stripe_key == 'stripe_key' || $basicPayment->stripe_secret == 'stripe_secret' || $basicPayment->stripe_key == '' || $basicPayment->stripe_secret == '')) {
return (object) [
'status' => true,
'message' => __('Stripe credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.basicpayment',
];
}
if ($basicPayment->paypal_status !== 'inactive' && ($basicPayment->paypal_client_id == 'paypal_client_id' || $basicPayment->paypal_secret_key == 'paypal_secret_key' || $basicPayment->paypal_client_id == '' || $basicPayment->paypal_secret_key == '')) {
return (object) [
'status' => true,
'message' => __('Paypal credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.basicpayment',
];
}
}
if (!Cache::has('payment_setting') && Module::isEnabled('PaymentGateway')) {
Cache::rememberForever('payment_setting', function () {
$payment_info = PaymentGateway::get();
$payment_setting = [];
foreach ($payment_info as $payment_item) {
$payment_setting[$payment_item->key] = $payment_item->value;
}
return (object) $payment_setting;
});
}
if (Cache::has('payment_setting') && $paymentAddons = Cache::get('payment_setting')) {
if ($paymentAddons->razorpay_status !== 'inactive' && ($paymentAddons->razorpay_key == 'razorpay_key' || $paymentAddons->razorpay_secret == 'razorpay_secret' || $paymentAddons->razorpay_key == '' || $paymentAddons->razorpay_secret == '')) {
return (object) [
'status' => true,
'message' => __('Razorpay credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.paymentgateway',
];
}
if ($paymentAddons->flutterwave_status !== 'inactive' && ($paymentAddons->flutterwave_public_key == 'flutterwave_public_key' || $paymentAddons->flutterwave_secret_key == 'flutterwave_secret_key' || $paymentAddons->flutterwave_public_key == '' || $paymentAddons->flutterwave_secret_key == '')) {
return (object) [
'status' => true,
'message' => __('Flutterwave credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.paymentgateway',
];
}
if ($paymentAddons->paystack_status !== 'inactive' && ($paymentAddons->paystack_public_key == 'paystack_public_key' || $paymentAddons->paystack_secret_key == 'paystack_secret_key' || $paymentAddons->paystack_public_key == '' || $paymentAddons->paystack_secret_key == '')) {
return (object) [
'status' => true,
'message' => __('Paystack credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.paymentgateway',
];
}
if ($paymentAddons->mollie_status !== 'inactive' && ($paymentAddons->mollie_key == 'mollie_key' || $paymentAddons->mollie_key == '')) {
return (object) [
'status' => true,
'message' => __('Mollie credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.paymentgateway',
];
}
if ($paymentAddons->instamojo_status !== 'inactive' && ($paymentAddons->instamojo_api_key == 'instamojo_api_key' || $paymentAddons->instamojo_auth_token == 'instamojo_auth_token' || $paymentAddons->instamojo_api_key == '' || $paymentAddons->instamojo_auth_token == '')) {
return (object) [
'status' => true,
'message' => __('Instamojo credentails not found'),
'description' => __('This may create a problem while making payment. Please fill up the credential to avoid any problem.'),
'route' => 'admin.paymentgateway',
];
}
}
return false;
}
}
if (!function_exists('isRoute')) {
function isRoute(string | array $route, string $returnValue = null) {
if (is_array($route)) {
foreach ($route as $value) {
if (Route::is($value)) {
return is_null($returnValue) ? true : $returnValue;
}
}
return false;
}
if (Route::is($route)) {
return is_null($returnValue) ? true : $returnValue;
}
return false;
}
}
// get default language
if (!function_exists('getDefaultLanguage')) {
function getDefaultLanguage(): string {
// cache default language
$defaultLanguage = Cache::rememberForever('defaultLanguage', function () {
try {
return Language::where('is_default', 1)->first()->code;
} catch (\Exception $e) {
info($e->getMessage());
return 'en';
}
});
return $defaultLanguage;
}
}
/**
* Set the tab step for the form
*
* @param string $name name of the tab session
* @param string $step current step of the tab
*
* @return void
*/
if (!function_exists('setFormTabStep')) {
function setFormTabStep(string $name, string $step): void {
session()->flash($name, $step);
}
}
/**
* Get all countries from cache
*
* @return Collection all countries
*/
if (!function_exists('countries')) {
function countries() {
return Cache::rememberForever("countries", fn() => Country::all());
}
}
if (!function_exists('instructorStatus')) {
function instructorStatus() {
return auth('web')->user()?->instructorInfo?->status;
}
}
if (!function_exists('customCode')) {
function customCode() {
return Cache::rememberForever('customCode', function () {
return CustomCode::select('css', 'header_javascript', 'javascript')->first();
});
}
}
/** Truncate string function */
if (!function_exists('truncate')) {
function truncate($text, $limit = 60) {
$text = $text ?? '';
if (mb_strlen($text) > $limit) {
return mb_substr($text, 0, $limit) . '...';
}
return $text;
}
}
/** Format date function */
if (!function_exists('formatDate')) {
function formatDate($date, $format = 'd M, Y') {
return Carbon::parse($date)->format($format);
}
}
if (!function_exists('formatTime')) {
function formatTime($date, $format = 'h:i a') {
return Carbon::parse($date)->format($format);
}
}
if (!function_exists('formattedDateTime')) {
function formattedDateTime($datetime) {
return formatDate($datetime) . ' - ' . formatTime($datetime);
}
}
/** Format minutes to hours */
if (!function_exists('minutesToHours')) {
function minutesToHours($minutesToHours) {
if ($minutesToHours === 0 || $minutesToHours === null) {
return '--.--';
}
$hours = floor($minutesToHours / 60);
$minutes = $minutesToHours % 60;
return $hours . 'h ' . ($minutes ? $minutes . 'm' : '');
}
}
/** Set enrollment ids in session */
if (!function_exists('setEnrollmentIdsInSession')) {
function setEnrollmentIdsInSession() {
if (auth('web')->check()) {
$enrollmentsIds = Enrollment::where('user_id', userAuth()->id)->pluck('course_id')->toArray();
session()->put('enrollments', $enrollmentsIds);
return;
}
session()->put('enrollments', []);
}
}
/** Set instructor course ids in session */
if (!function_exists('setInstructorCourseIdsInSession')) {
function setInstructorCourseIdsInSession() {
if (auth('web')->check() && userAuth()->role == 'instructor') {
$enrollmentsIds = Course::where('instructor_id', userAuth()->id)->pluck('id')->toArray();
session()->put('instructor_courses', $enrollmentsIds);
return;
}
session()->put('instructor_courses', []);
}
}
if (!function_exists('processText')) {
function processText($text) {
// Replace text within square brackets with a