Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/GlobalSetting.tar
Назад
lang/.gitkeep 0000644 00000000000 15012236406 0007103 0 ustar 00 module.json 0000644 00000000366 15012236406 0006730 0 ustar 00 { "name": "GlobalSetting", "alias": "globalsetting", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\GlobalSetting\\app\\Providers\\GlobalSettingServiceProvider" ], "files": [] } tests/Unit/.gitkeep 0000644 00000000000 15012236406 0010243 0 ustar 00 tests/Feature/.gitkeep 0000644 00000000000 15012236406 0010717 0 ustar 00 vite.config.js 0000644 00000001320 15012236406 0007310 0 ustar 00 import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: '../../public/build-globalsetting', emptyOutDir: true, manifest: true, }, plugins: [ laravel({ publicDirectory: '../../public', buildDirectory: 'build-globalsetting', input: [ __dirname + '/resources/assets/sass/app.scss', __dirname + '/resources/assets/js/app.js' ], refresh: true, }), ], }); //export const paths = [ // 'Modules/$STUDLY_NAME$/resources/assets/sass/app.scss', // 'Modules/$STUDLY_NAME$/resources/assets/js/app.js', //]; wsus.json 0000644 00000000631 15012236406 0006437 0 ustar 00 { "name": "Global Settings Addon", "is_default": true, "description": "This is Settings Addon", "author": { "name": "Websolutionsus", "email": "websolutionus1@gmail.com", "website": "https://websolutionus.com" }, "license": "Proprietary", "url": "", "options" : { "route" : "home" }, "last_update": "3/31/2024", "version": "1.0.0" } routes/.gitkeep 0000644 00000000000 15012236406 0007503 0 ustar 00 routes/error_log 0000644 00000001130 15012236406 0007774 0 ustar 00 [12-May-2025 18:11:03 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/routes/web.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/routes/web.php on line 8 [13-May-2025 17:04:30 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/routes/api.php:5 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/routes/api.php on line 5 routes/web.php 0000644 00000011372 15012236406 0007356 0 ustar 00 <?php use Illuminate\Support\Facades\Route; use Modules\GlobalSetting\app\Http\Controllers\EmailSettingController; use Modules\GlobalSetting\app\Http\Controllers\GlobalSettingController; use Modules\GlobalSetting\app\Http\Controllers\ManageAddonController; Route::group(['as' => 'admin.', 'prefix' => 'admin', 'middleware' => ['auth:admin', 'translation']], function () { Route::controller(GlobalSettingController::class)->group(function () { Route::get('general-setting', 'general_setting')->name('general-setting'); Route::put('update-general-setting', 'update_general_setting')->name('update-general-setting'); Route::put('update-logo-favicon', 'update_logo_favicon')->name('update-logo-favicon'); Route::put('update-primary-color', 'update_primary_color')->name('update-primary-color'); Route::put('update-cookie-consent', 'update_cookie_consent')->name('update-cookie-consent'); Route::put('update-section-control', 'update_section_control')->name('update-section-control'); Route::put('update-custom-pagination', 'update_custom_pagination')->name('update-custom-pagination'); Route::put('update-default-avatar', 'update_default_avatar')->name('update-default-avatar'); Route::put('update-breadcrumb', 'update_breadcrumb')->name('update-breadcrumb'); Route::put('update-background-image', 'update_background_image')->name('update-background-image'); Route::put('update-copyright-text', 'update_copyright_text')->name('update-copyright-text'); Route::put('update-maintenance-mode-status', 'update_maintenance_mode_status')->name('update-maintenance-mode-status'); Route::put('update-maintenance-mode', 'update_maintenance_mode')->name('update-maintenance-mode'); Route::get('seo-setting', 'seo_setting')->name('seo-setting'); Route::put('update-seo-setting/{id}', 'update_seo_setting')->name('update-seo-setting'); Route::get('crediential-setting', 'crediential_setting')->name('crediential-setting'); Route::put('update-google-captcha', 'update_google_captcha')->name('update-google-captcha'); Route::put('update-google-tag', 'update_google_tag')->name('update-google-tag'); Route::put('update-tawk-chat', 'update_tawk_chat')->name('update-tawk-chat'); Route::put('update-google-analytic', 'update_google_analytic')->name('update-google-analytic'); Route::put('update-facebook-pixel', 'update_facebook_pixel')->name('update-facebook-pixel'); Route::put('update-social-login', 'update_social_login')->name('update-social-login'); Route::put('update-pusher', 'update_pusher')->name('update-pusher'); Route::get('cache-clear', 'cache_clear')->name('cache-clear'); Route::post('cache-clear', 'cache_clear_confirm')->name('cache-clear-confirm'); Route::get('database-clear', 'database_clear')->name('database-clear'); Route::delete('database-clear-success', 'database_clear_success')->name('database-clear-success'); Route::get('custom-code', 'customCode')->name('custom-code'); Route::post('update-custom-code', 'customCodeUpdate')->name('update-custom-code'); Route::get('system-update', 'systemUpdate')->name('system-update.index'); Route::post('system-update/store', 'systemUpdateStore')->name('system-update.store'); Route::post('system-update/redirect', 'systemUpdateRedirect')->name('system-update.redirect'); Route::delete('system-update/delete', 'systemUpdateDelete')->name('system-update.delete'); }); Route::controller(EmailSettingController::class)->group(function () { Route::get('email-configuration', 'email_config')->name('email-configuration'); Route::put('update-email-configuration', 'update_email_config')->name('update-email-configuration'); Route::get('edit-email-template/{id}', 'edit_email_template')->name('edit-email-template'); Route::put('update-email-template/{id}', 'update_email_template')->name('update-email-template'); Route::post('test/mail/credentials', 'test_mail_credentials')->name('test-mail-credentials'); }); Route::controller(ManageAddonController::class)->prefix('settings')->group(function () { Route::get('addons', 'index')->name('addons.view'); Route::get('addons/install', 'installAddon')->name('addons.install'); Route::get('addons/update/{slug}', 'updateStatus')->name('addons.update.status'); Route::post('addons/store', 'installStore')->name('addons.store'); Route::post('addons/install', 'installProcessStart')->name('addons.install.start'); Route::delete('addons/delete', 'deleteAddon')->name('addons.delete'); Route::delete('addons/uninstall/{slug}', 'uninstallAddon')->name('addons.uninstall'); }); }); routes/api.php 0000644 00000000215 15012236406 0007344 0 ustar 00 <?php use Illuminate\Support\Facades\Route; Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () { }); composer.json 0000644 00000001341 15012236406 0007264 0 ustar 00 { "name": "nwidart/globalsetting", "description": "", "authors": [ { "name": "Nicolas Widart", "email": "n.widart@gmail.com" } ], "extra": { "laravel": { "providers": [], "aliases": { } } }, "autoload": { "psr-4": { "Modules\\GlobalSetting\\": "", "Modules\\GlobalSetting\\App\\": "app/", "Modules\\GlobalSetting\\Database\\Factories\\": "database/factories/", "Modules\\GlobalSetting\\Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Modules\\GlobalSetting\\Tests\\": "tests/" } } } config/config.php 0000644 00000000062 15012236406 0007764 0 ustar 00 <?php return [ 'name' => 'GlobalSetting', ]; config/.gitkeep 0000644 00000000000 15012236406 0007427 0 ustar 00 package.json 0000644 00000000410 15012236406 0007024 0 ustar 00 { "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.5", "sass": "^1.69.5", "postcss": "^8.3.7", "vite": "^4.0.0" } } app/Http/Controllers/ManageAddonController.php 0000644 00000043660 15012236406 0015474 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Http\Controllers; use Exception; use ZipArchive; use App\Models\CustomAddon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Spatie\Permission\Models\Role; use Illuminate\Support\Facades\Log; use Nwidart\Modules\Facades\Module; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Artisan; use Spatie\Permission\Models\Permission; use Modules\GlobalSetting\app\Models\Setting; use Modules\GlobalSetting\app\Traits\ArchiveHelperTrait; class ManageAddonController extends Controller { use ArchiveHelperTrait; public function index() { $addons = CustomAddon::latest()->get(); return view('globalsetting::addons.manage_addon', ['addons' => $addons]); } public function installAddon() { $files = glob(public_path('addons_files') . '/*'); $addonFiles = []; foreach ($files as $file) { if (pathinfo($file, PATHINFO_EXTENSION) === 'zip' && $this->isFirstDirAddons($file)) { $fileName = pathinfo($file, PATHINFO_FILENAME); $fileExtension = pathinfo($file, PATHINFO_EXTENSION); $addonFiles[$fileName . '.' . $fileExtension] = $this->checkAndReadJsonFile($file); } } return view('globalsetting::addons.install_addon', ['addonFiles' => $addonFiles]); } /** * @param Request $request */ public function installStore(Request $request) { $request->validate([ 'zip_file' => 'required|mimes:zip', ]); $zipFilePath = public_path('addons_files/addon.zip'); if (File::exists($zipFilePath)) { File::delete($zipFilePath); } // Store the uploaded file $zipFile = $request->file('zip_file'); $zipFilePath = $zipFile->move(public_path('addons_files'), 'addon.zip'); if (!$this->isFirstDirAddons($zipFilePath) && !$this->checkAndReadJsonFile($zipFilePath)) { File::delete($zipFilePath); $notification = __('Invalid Addon File Structure'); $notification = ['message' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } $notification = __('Uploaded Successfully'); $notification = ['message' => $notification, 'alert-type' => 'success']; return back()->with($notification); } public function installProcessStart() { Cache::forget('dynamic_translatable_models'); $zipFilePath = public_path('addons_files/addon.zip'); if (!File::exists($zipFilePath)) { $notification = __('No Addon File Found'); $notification = ['message' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } if (!$this->isFirstDirAddons($zipFilePath)) { $notification = __('Invalid Addon File Structure'); $notification = ['message' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } $file = $zipFilePath; if (pathinfo($file, PATHINFO_EXTENSION) === 'zip' && $this->isFirstDirAddons($file)) { $addonFile = $this->checkAndReadJsonFile($file); //application version check if (property_exists($addonFile, 'minimum_version') && !empty($addonFile?->minimum_version)) { $setting = Cache::get('setting'); $version = $setting?->version ?? Setting::where('key', 'version')->value('value'); if (!version_compare($version, $addonFile?->minimum_version, '>=')) { return redirect()->back()->with([ 'message' => __('Addon requires application version').' >= '.$addonFile?->minimum_version.'. '.__('Current version').': '.$version, 'alert-type' => 'error', ]); } } $addonFileJson = json_decode(json_encode($addonFile), true); // check if addon is for the current application if (isset($addonFileJson['item'])) { $item = $addonFileJson['item']; if (!(isset($item['alias']) && $item['alias'] == 'topland' && isset($item['unique_id']) && $item['unique_id'] == '36467538')) { return redirect()->back()->with([ 'message' => __('Addon is not for suitable for this application'), 'alert-type' => 'error', ]); } } else { return redirect()->back()->with([ 'message' => __('Addon is not for suitable for this application'), 'alert-type' => 'error', ]); } $addonExist = CustomAddon::where('name', $addonFile->name)->first(); if ($addonExist && count($addonFileJson) > 0 && ($addonFile?->version == $addonExist?->version)) { $notification = __('Addon Already Installed'); $notification = ['message' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } try { $zip = new ZipArchive; if ($zip->open($zipFilePath) === true) { $zip->extractTo(base_path()); $zip->close(); } else { $notification = __('Corrupted Zip File'); $notification = ['message' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } } catch (Exception $e) { Log::error($e->getMessage()); $notification = __('Corrupted Zip File'); $notification = ['message' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } $moduleSlug = null; try { $getModuleJson = $this->checkAndReadJsonFile($file, 'module.json'); $moduleSlug = $getModuleJson->name; DB::beginTransaction(); $customAddon = new CustomAddon(); $customAddon->slug = $getModuleJson->name; foreach ($addonFileJson as $key => $value) { if ($key === 'minimum_version' || $key === 'item') { continue; } $customAddon->$key = is_array($value) ? json_encode($value) : $value; } $customAddon->status = 0; $customAddon->save(); Module::register($customAddon->slug); $wsusJson = $this->checkAndReadJsonFile($file); $this->insertRoleAndPermissions($moduleSlug, $wsusJson); $this->moveAssetFiles($wsusJson, $moduleSlug); DB::commit(); unlink($zipFilePath); $notification = __('Installed Successfully'); $notification = ['message' => $notification, 'alert-type' => 'success']; } catch (Exception $e) { DB::rollBack(); Module::find($moduleSlug)?->delete(); logger()->error($e->getMessage()); $notification = __('Something went wrong'); $notification = ['message' => $notification, 'alert-type' => 'error']; } } return to_route('admin.addons.view')->with($notification); } /** * @param $permissions */ private function insertRoleAndPermissions($slug, $wsusJson) { try { if (Module::find($slug) && isset($wsusJson->options->role_permission)) { $rolePermission = $wsusJson->options->role_permission; // Ensure permissions exist and are an array if (isset($rolePermission->permissions) && is_array($rolePermission->permissions) && count($rolePermission->permissions) > 0) { $permissions = $rolePermission->permissions; $permissionGroup = $rolePermission->group_name ?? 'default'; // Loop through each permission and insert/update in database foreach ($permissions as $permissionName) { $permission = Permission::updateOrCreate([ 'name' => $permissionName, 'group_name' => $permissionGroup, 'guard_name' => 'admin', ]); // Assign the permission to the "Super Admin" role Role::where(['name' => 'Super Admin', 'guard_name' => 'admin']) ->first()?->givePermissionTo($permission); } } } } catch (Exception $e) { logger()->error($e->getMessage()); } } /** * @param string $slug */ private function removeRoleAndPermissions(string $slug) { try { // Correct the JSON path for the addon $jsonPath = base_path("Modules/{$slug}/wsus.json"); // Check if the module and JSON file exist if (Module::find($slug) && file_exists($jsonPath)) { // Decode the JSON file $wsusJson = json_decode(file_get_contents($jsonPath)); if (isset($wsusJson->options->role_permission)) { $rolePermission = $wsusJson->options->role_permission; // Ensure permissions exist and are an array if (isset($rolePermission->permissions) && is_array($rolePermission->permissions) && count($rolePermission->permissions) > 0) { $permissions = $rolePermission->permissions; $permissionGroup = $rolePermission->group_name ?? 'default'; // Loop through each permission and remove it from the database foreach ($permissions as $permissionName) { $permission = Permission::where([ 'name' => $permissionName, 'group_name' => $permissionGroup, 'guard_name' => 'admin', ])->first(); if ($permission) { // Detach permission from roles and delete $permission->roles()->detach(); $permission->delete(); } } } } } } catch (Exception $e) { logger()->error($e->getMessage()); } } /** * @param $wsusJson * @param $moduleName */ public function moveAssetFiles($wsusJson, $moduleName) { if (isset($wsusJson->options->assets)) { $assets = $wsusJson->options->assets; // Process CSS assets if (isset($assets->css) && is_array($assets->css)) { foreach ($assets->css as $cssFile) { $this->moveFileToPublicPath($cssFile, $moduleName); } } // Process JS assets if (isset($assets->js) && is_array($assets->js)) { foreach ($assets->js as $jsFile) { $this->moveFileToPublicPath($jsFile, $moduleName); } } } } /** * @param $fileData * @param $moduleName */ private function moveFileToPublicPath($fileData, $moduleName) { $sourcePath = base_path('Modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . ltrim(str_replace('/', DIRECTORY_SEPARATOR, $fileData->path), DIRECTORY_SEPARATOR)); $destinationPath = public_path(str_replace('/', DIRECTORY_SEPARATOR, $fileData->pasteTo)); // Ensure the destination directory exists or create it if (!File::isDirectory($destinationPath)) { File::makeDirectory($destinationPath, 0755, true); } // Check if the source file exists before moving if (File::exists($sourcePath)) { $destinationFullPath = $destinationPath . DIRECTORY_SEPARATOR . basename($sourcePath); // Copy the file and log the operation File::copy($sourcePath, $destinationFullPath); logger()->info("Moved {$sourcePath} to {$destinationFullPath}"); } else { logger()->error("Source file not found: {$sourcePath}"); } } /** * @param $slug */ public function updateStatus($slug) { $addon = CustomAddon::whereSlug($slug)->firstOrFail(); $status = $addon->status == 1 ? 0 : 1; Module::scan(); if (!Module::has($addon->slug)) { $notification = __('Addon Not Found'); $notification = ['message' => $notification, 'alert-type' => 'error']; return back()->with($notification); } if ($status) { Module::enable($addon->slug); $module = Module::find($addon->slug); if ($module->isEnabled()) { $addon->status = $status; // write code to inject the code into the sidebarfile $sidebarFilePath = base_path('resources/views/admin/addons.blade.php'); $sidebarFileContent = File::get($sidebarFilePath); $injectedCode = "\n@includeIf('" . $module->getLowerName() . "::sidebar')"; if (strpos($sidebarFileContent, $injectedCode) === false) { // Add the injected code $updatedSidebarFileContent = str_replace('<!-- Addon:Sidebar -->', '<!-- Addon:Sidebar -->' . $injectedCode, $sidebarFileContent); // Write the updated content to the file File::put($sidebarFilePath, $updatedSidebarFileContent); } // write code to migrate the module $name = $module->getName(); if (!$this->moduleMigration($name)) { $module->disable(); } } } else { $module = Module::find($addon->slug); $module->disable(); if ($module->isDisabled()) { $addon->status = $status; } } $addon->save(); $notification = __('Updated Successfully'); $notification = ['message' => $notification, 'alert-type' => 'success']; return back()->with($notification); } /** * @param $module */ public function moduleMigration($module) { try { Artisan::call('module:migrate', [ 'module' => $module, '--force' => true, ]); $seederClass = "Modules\\$module\\Database\\Seeders\\{$module}DatabaseSeeder"; // Check if the seeder class exists if (class_exists($seederClass)) { Artisan::call('db:seed', [ '--class' => $seederClass, '--force' => true, ]); } else { Log::warning("Seeder class not found: $seederClass"); } return true; } catch (\Exception $e) { Log::info($e); return false; } } /** * @param $module */ public function moduleMigrationRollback($module) { try { Artisan::call('module:migrate-rollback', [ 'module' => $module, '--force' => true, ]); return true; } catch (Exception $e) { Log::info($e); return false; } } public function ModuleRefresh() { try { exec('php composer.phar dump-autoload'); Artisan::call('cache:clear'); Artisan::call('view:clear'); Artisan::call('config:clear'); } catch (Exception $e) { logger()->error($e->getMessage()); } } /** * @param $slug */ public function uninstallAddon($slug) { $addon = CustomAddon::whereSlug($slug)->firstOrFail(); Module::scan(); $module = Module::find($addon->slug); if (!Module::has($addon->slug)) { $notification = __('Addon Not Found'); $notification = ['message' => $notification, 'alert-type' => 'error']; return back()->with($notification); } try { $this->moduleMigrationRollback($slug); $this->removeRoleAndPermissions($slug); } catch (Exception $e) { info($e); } if ($module->delete()) { $addon->delete(); // write code to remove the code from the sidebar file $sidebarFilePath = base_path('resources/views/admin/addons.blade.php'); $sidebarFileContent = File::get($sidebarFilePath); $injectedCode = "\n@includeIf('" . $module->getLowerName() . "::sidebar')"; if (strpos($sidebarFileContent, $injectedCode)) { $updatedSidebarFileContent = str_replace($injectedCode, '', $sidebarFileContent); File::put($sidebarFilePath, $updatedSidebarFileContent); } } $notification = __('Deleted Successfully'); $notification = ['message' => $notification, 'alert-type' => 'success']; return back()->with($notification); } public function deleteAddon() { $this->deleteFolderAndFiles(public_path('addons_files')); $notification = __('Deleted Successfully'); $notification = ['message' => $notification, 'alert-type' => 'success']; return back()->with($notification); } } app/Http/Controllers/GlobalSettingController.php 0000644 00000107320 15012236406 0016066 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Http\Controllers; use ZipArchive; use App\Models\User; use App\Models\Admin; use App\Models\WishList; use Illuminate\Http\Request; use Modules\Faq\app\Models\Faq; use Modules\Blog\app\Models\Blog; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Cache; use Modules\Career\app\Models\Career; use Modules\Location\app\Models\City; use Modules\Slider\app\Models\Slider; use Illuminate\Support\Facades\Artisan; use Modules\AboutUs\app\Models\AboutUs; use Modules\Counter\app\Models\Counter; use Modules\OurTeam\app\Models\OurTeam; use Modules\Service\app\Models\Service; use Modules\Blog\app\Models\BlogComment; use Modules\Location\app\Models\Country; use Modules\Property\app\Models\Aminity; use Modules\Blog\app\Models\BlogCategory; use Modules\Language\app\Models\Language; use Modules\Property\app\Models\Property; use Modules\Faq\app\Models\FaqTranslation; use Modules\Blog\app\Models\BlogTranslation; use Modules\Career\app\Models\CareerRequest; use Modules\CustomPage\app\Models\CustomPage; use Modules\GlobalSetting\app\Models\Setting; use Modules\Location\app\Models\CountryState; use Modules\NewsLetter\app\Models\NewsLetter; use Modules\Property\app\Models\PropertyType; use Modules\SocialLink\app\Models\SocialLink; use Modules\Customer\app\Models\BannedHistory; use Modules\Property\app\Models\PropertyImage; use Modules\Property\app\Models\PropertyReview; use Modules\Testimonial\app\Models\Testimonial; use Modules\Career\app\Models\CareerTranslation; use Modules\GlobalSetting\app\Models\CustomCode; use Modules\GlobalSetting\app\Models\SeoSetting; use Modules\Property\app\Models\NearestLocation; use Modules\Property\app\Models\PropertyAminity; use Modules\Slider\app\Models\SliderTranslation; use Modules\AboutUs\app\Models\AboutUsTranslation; use Modules\Counter\app\Models\CounterTranslation; use Modules\CustomMenu\app\Models\MenuTranslation; use Modules\Service\app\Models\ServiceTranslation; use Modules\Property\app\Models\AminityTranslation; use Modules\Blog\app\Models\BlogCategoryTranslation; use Modules\GlobalSetting\app\Models\SectionControl; use Modules\Property\app\Models\PropertyTranslation; use Modules\ContactMessage\app\Models\ContactMessage; use Modules\GlobalSetting\app\Models\BackgroundImage; use Modules\Subscription\app\Models\SubscriptionPlan; use Modules\CustomMenu\app\Models\MenuItemTranslation; use Modules\GlobalSetting\app\Models\CustomPagination; use Modules\GlobalSetting\app\Enums\WebsiteSettingEnum; use Modules\CustomPage\app\Models\CustomPageTranslation; use Modules\Property\app\Models\PropertyNearestLocation; use Modules\Property\app\Models\PropertyTypeTranslation; use Modules\Subscription\app\Models\SubscriptionHistory; use Modules\ContactUs\app\Models\ContactUsPageTranslation; use Modules\Testimonial\app\Models\TestimonialTranslation; use Modules\Property\app\Models\NearestLocationTranslation; use Modules\Property\app\Models\PropertyPurposeTranslation; use Modules\PrivacyPolicy\app\Models\PrivacyPolicyTranslation; use Modules\ContactUs\app\Models\ContactInformationTranslation; use Modules\TermsAndCondition\app\Models\TermsAndConditionTranslation; class GlobalSettingController extends Controller { protected $cachedSetting; public function __construct() { $this->cachedSetting = Cache::get('setting'); } public function general_setting() { checkAdminHasPermissionAndThrowException('setting.view'); $custom_paginations = CustomPagination::all(); $all_timezones = WebsiteSettingEnum::allTimeZones(); $all_time_format = WebsiteSettingEnum::allTimeFormat(); $all_date_format = WebsiteSettingEnum::allDateFormat(); $control_sections = SectionControl::get(); $backgroundImage = BackgroundImage::first(); return view('globalsetting::settings.index', compact('custom_paginations','all_timezones', 'all_time_format', 'all_date_format', 'control_sections', 'backgroundImage')); } public function update_general_setting(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'app_name' => 'sometimes', 'selected_theme' => 'sometimes', 'timezone' => 'sometimes', 'contact_message_receiver_mail' => 'sometimes|email', 'is_queable' => 'sometimes|in:active,inactive', 'comments_auto_approved' => 'sometimes|in:active,inactive', ], [ 'app_name.required' => __('App name is required'), 'selected_theme' => trans('Theme name is required'), 'timezone.required' => __('Timezone is required'), 'is_queable.required' => __('Queue is required'), 'contact_message_receiver_mail.email' => __('The contact message receiver mail must be a valid email address.'), 'is_queable.in' => __('Queue is invalid'), 'comments_auto_approved.in' => __('Review auto approved is invalid'), ]); foreach ($request->except('_token') as $key => $value) { Setting::where('key', $key)->update(['value' => $value]); } Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_logo_favicon(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); if ($request->file('logo')) { $file_name = file_upload($request->logo, 'uploads/website-images/', $this->cachedSetting?->logo); Setting::where('key', 'logo')->update(['value' => $file_name]); } if ($request->file('home1_footer_logo')) { $file_name = file_upload($request->home1_footer_logo, 'uploads/website-images/', $this->cachedSetting?->home1_footer_logo); Setting::where('key', 'home1_footer_logo')->update(['value' => $file_name]); } if ($request->file('home2_logo')) { $file_name = file_upload($request->home2_logo, 'uploads/website-images/', $this->cachedSetting?->home2_logo); Setting::where('key', 'home2_logo')->update(['value' => $file_name]); } if ($request->file('home3_logo')) { $file_name = file_upload($request->home3_logo, 'uploads/website-images/', $this->cachedSetting?->home3_logo); Setting::where('key', 'home3_logo')->update(['value' => $file_name]); } if ($request->file('favicon')) { $file_name = file_upload($request->favicon, 'uploads/website-images/', $this->cachedSetting?->favicon); Setting::where('key', 'favicon')->update(['value' => $file_name]); } Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_primary_color(Request $request){ checkAdminHasPermissionAndThrowException('setting.update'); Setting::where('key', 'theme1_primary_color')->update(['value' => $request->theme1_primary_color]); Setting::where('key', 'theme2_primary_color')->update(['value' => $request->theme2_primary_color]); Setting::where('key', 'theme3_primary_color')->update(['value' => $request->theme3_primary_color]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_section_control(Request $request){ foreach($request->ids as $index => $id){ $section = SectionControl::find($id); $section->status = $request->status[$index]; $section->qty = $request->quanities[$index]; $section->save(); } $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_cookie_consent(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'cookie_status' => 'required', 'border' => 'required', 'corners' => 'required', 'background_color' => 'required', 'text_color' => 'required', 'border_color' => 'required', 'btn_bg_color' => 'required', 'btn_text_color' => 'required', 'link_text' => 'required', 'btn_text' => 'required', 'message' => 'required', ], [ 'cookie_status.required' => __('Status is required'), 'border.required' => __('Border is required'), 'corners.required' => __('Corner is required'), 'background_color.required' => __('Background color is required'), 'text_color.required' => __('Text color is required'), 'border_color.required' => __('Border Color is required'), 'btn_bg_color.required' => __('Button color is required'), 'btn_text_color.required' => __('Button text color is required'), 'link_text.required' => __('Link text is required'), 'btn_text.required' => __('Button text is required'), 'message.required' => __('Message is required'), ]); Setting::where('key', 'cookie_status')->update(['value' => $request->cookie_status]); Setting::where('key', 'border')->update(['value' => $request->border]); Setting::where('key', 'corners')->update(['value' => $request->corners]); Setting::where('key', 'background_color')->update(['value' => $request->background_color]); Setting::where('key', 'text_color')->update(['value' => $request->text_color]); Setting::where('key', 'border_color')->update(['value' => $request->border_color]); Setting::where('key', 'btn_bg_color')->update(['value' => $request->btn_bg_color]); Setting::where('key', 'btn_text_color')->update(['value' => $request->btn_text_color]); Setting::where('key', 'link_text')->update(['value' => $request->link_text]); Setting::where('key', 'btn_text')->update(['value' => $request->btn_text]); Setting::where('key', 'message')->update(['value' => $request->message]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_custom_pagination(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); foreach ($request->quantities as $index => $quantity) { if ($request->quantities[$index] == '') { $notification = [ 'messege' => __('Every field are required'), 'alert-type' => 'error', ]; return redirect()->back()->with($notification); } $custom_pagination = CustomPagination::find($request->ids[$index]); $custom_pagination->item_qty = $request->quantities[$index]; $custom_pagination->save(); } // Cache update $custom_pagination = CustomPagination::all(); $pagination = []; foreach ($custom_pagination as $item) { $pagination[str_replace(' ', '_', strtolower($item->section_name))] = $item->item_qty; } $pagination = (object) $pagination; Cache::put('CustomPagination', $pagination); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_default_avatar(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); if ($request->file('default_avatar')) { $file_name = file_upload($request->default_avatar, 'uploads/website-images/', $this->cachedSetting?->default_avatar); Setting::where('key', 'default_avatar')->update(['value' => $file_name]); } Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_breadcrumb(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); if ($request->file('breadcrumb_image')) { $file_name = file_upload($request->breadcrumb_image, 'uploads/website-images/', $this->cachedSetting?->breadcrumb_image); Setting::where('key', 'breadcrumb_image')->update(['value' => $file_name]); } Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_background_image(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $backgroundImage = BackgroundImage::first(); if ($request->file('service_background_image')) { $file_name = file_upload($request->service_background_image, 'uploads/website-images/', $oldFile = $backgroundImage->service_background_image); $backgroundImage->service_background_image = $file_name; } $backgroundImage->save(); Cache::forget('backgroundImage'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_copyright_text(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'copyright_text' => 'required', ], [ 'copyright_text' => __('Copyright Text is required'), ]); Setting::where('key', 'copyright_text')->update(['value' => $request->copyright_text]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function crediential_setting() { checkAdminHasPermissionAndThrowException('setting.view'); return view('globalsetting::credientials.index'); } public function update_google_captcha(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'recaptcha_site_key' => 'required', 'recaptcha_secret_key' => 'required', 'recaptcha_status' => 'required', ], [ 'recaptcha_site_key.required' => __('Site key is required'), 'recaptcha_secret_key.required' => __('Secret key is required'), 'recaptcha_status.required' => __('Status is required'), ]); Setting::where('key', 'recaptcha_site_key')->update(['value' => $request->recaptcha_site_key]); Setting::where('key', 'recaptcha_secret_key')->update(['value' => $request->recaptcha_secret_key]); Setting::where('key', 'recaptcha_status')->update(['value' => $request->recaptcha_status]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_google_tag(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'googel_tag_status' => 'required', 'googel_tag_id' => 'required', ], [ 'googel_tag_status.required' => __('Status is required'), 'googel_tag_id.required' => __('Google Tag ID is required'), ]); Setting::where('key', 'googel_tag_status')->update(['value' => $request->googel_tag_status]); Setting::where('key', 'googel_tag_id')->update(['value' => $request->googel_tag_id]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_tawk_chat(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'tawk_status' => 'required', 'tawk_chat_link' => 'required', ], [ 'tawk_status.required' => __('Status is required'), 'tawk_chat_link.required' => __('Chat link is required'), ]); Setting::where('key', 'tawk_status')->update(['value' => $request->tawk_status]); Setting::where('key', 'tawk_chat_link')->update(['value' => $request->tawk_chat_link]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_google_analytic(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'google_analytic_status' => 'required', 'google_analytic_id' => 'required', ], [ 'google_analytic_status.required' => __('Status is required'), 'google_analytic_id.required' => __('Analytic id is required'), ]); Setting::where('key', 'google_analytic_status')->update(['value' => $request->google_analytic_status]); Setting::where('key', 'google_analytic_id')->update(['value' => $request->google_analytic_id]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_facebook_pixel(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'pixel_status' => 'required', 'pixel_app_id' => 'required', ], [ 'pixel_status.required' => __('Status is required'), 'pixel_app_id.required' => __('App id is required'), ]); Setting::where('key', 'pixel_status')->update(['value' => $request->pixel_status]); Setting::where('key', 'pixel_app_id')->update(['value' => $request->pixel_app_id]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_social_login(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $rules = [ 'google_login_status' => 'required', 'gmail_client_id' => 'required', 'gmail_secret_id' => 'required', ]; $customMessages = [ 'google_login_status.required' => __('Google is required'), 'gmail_client_id.required' => __('Google client is required'), 'gmail_secret_id.required' => __('Google secret is required'), ]; $request->validate($rules, $customMessages); Setting::where('key', 'facebook_login_status')->update(['value' => $request->facebook_login_status]); Setting::where('key', 'facebook_app_id')->update(['value' => $request->facebook_app_id]); Setting::where('key', 'facebook_app_secret')->update(['value' => $request->facebook_app_secret]); Setting::where('key', 'facebook_redirect_url')->update(['value' => $request->facebook_redirect_url]); Setting::where('key', 'google_login_status')->update(['value' => $request->google_login_status]); Setting::where('key', 'gmail_client_id')->update(['value' => $request->gmail_client_id]); Setting::where('key', 'gmail_secret_id')->update(['value' => $request->gmail_secret_id]); Setting::where('key', 'gmail_redirect_url')->update(['value' => $request->gmail_redirect_url]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_pusher(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'pusher_status' => 'required', 'pusher_app_id' => 'required', 'pusher_app_key' => 'required', 'pusher_app_secret' => 'required', 'pusher_app_cluster' => 'required', ], [ 'pusher_status.required' => __('Status is required'), 'pusher_app_id.required' => __('Pusher App ID is required'), 'pusher_app_key.required' => __('Pusher App Key is required'), 'pusher_app_secret.required' => __('Pusher App Secret is required'), 'pusher_app_cluster.required' => __('Pusher App Cluster is required'), ]); Setting::where('key', 'pusher_status')->update(['value' => $request->pusher_status]); Setting::where('key', 'pusher_app_id')->update(['value' => $request->pusher_app_id]); Setting::where('key', 'pusher_app_key')->update(['value' => $request->pusher_app_key]); Setting::where('key', 'pusher_app_secret')->update(['value' => $request->pusher_app_secret]); Setting::where('key', 'pusher_app_cluster')->update(['value' => $request->pusher_app_cluster]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function seo_setting() { checkAdminHasPermissionAndThrowException('setting.view'); $pages = SeoSetting::all(); return view('globalsetting::seo_setting', compact('pages')); } public function update_seo_setting(Request $request, $id) { checkAdminHasPermissionAndThrowException('setting.update'); $rules = [ 'seo_title' => 'required', 'seo_description' => 'required', ]; $customMessages = [ 'seo_title.required' => __('SEO title is required'), 'seo_description.required' => __('SEO description is required'), ]; $request->validate($rules, $customMessages); $page = SeoSetting::find($id); $page->seo_title = $request->seo_title; $page->seo_description = $request->seo_description; $page->save(); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function cache_clear() { checkAdminHasPermissionAndThrowException('setting.update'); return view('globalsetting::cache_clear'); } public function cache_clear_confirm() { checkAdminHasPermissionAndThrowException('setting.update'); Artisan::call('optimize:clear'); $notification = __('Cache cleared successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function database_clear() { checkAdminHasPermissionAndThrowException('setting.view'); return view('globalsetting::database_clear'); } public function database_clear_success(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate(['password' => 'required'], ['password.required' => __('Password is required')]); if (Hash::check($request->password, auth('admin')->user()->password)) { // truncate all model here Aminity::truncate(); AminityTranslation::truncate(); Blog::truncate(); BlogTranslation::truncate(); BlogCategoryTranslation::truncate(); BlogComment::truncate(); City::truncate(); ContactMessage::truncate(); Country::truncate(); CountryState::truncate(); CustomPage::truncate(); CustomPageTranslation::truncate(); Faq::truncate(); FaqTranslation::truncate(); NearestLocation::truncate(); NearestLocationTranslation::truncate(); SubscriptionPlan::truncate(); SubscriptionHistory::truncate(); OurTeam::truncate(); Property::truncate(); PropertyTranslation::truncate(); PropertyAminity::truncate(); PropertyImage::truncate(); PropertyNearestLocation::truncate(); PropertyReview::truncate(); PropertyType::truncate(); PropertyTypeTranslation::truncate(); Service::truncate(); ServiceTranslation::truncate(); Slider::truncate(); SliderTranslation::truncate(); SocialLink::truncate(); NewsLetter::truncate(); Testimonial::truncate(); TestimonialTranslation::truncate(); User::truncate(); WishList::truncate(); BannedHistory::truncate(); Career::truncate(); CareerRequest::truncate(); CareerTranslation::truncate(); $blogCategories = BlogCategory::get(); foreach($blogCategories as $category){ $category->delete(); } $folderPath = public_path('uploads/custom-images'); $response = File::deleteDirectory($folderPath); $path = public_path('uploads/custom-images'); if(!File::isDirectory($path)){ File::makeDirectory($path, 0777, true, true); } $languages = Language::where('code', '!=', 'en')->get(); foreach($languages as $language){ CounterTranslation::where('lang_code', $language->code)->delete(); AboutUsTranslation::where('lang_code', $language->code)->delete(); PrivacyPolicyTranslation::where('lang_code', $language->code)->delete(); ContactInformationTranslation::where('lang_code', $language->code)->delete(); ContactUsPageTranslation::where('lang_code', $language->code)->delete(); PropertyPurposeTranslation::where('lang_code', $language->code)->delete(); PropertyTranslation::where('lang_code', $language->code)->delete(); MenuTranslation::where('lang_code', $language->code)->delete(); MenuItemTranslation::where('lang_code', $language->code)->delete(); TermsAndConditionTranslation::where('lang_code', $language->code)->delete(); $destinationPath = base_path('lang')."/{$language->code}.json"; File::delete($destinationPath); session()->forget('front_lang'); $language->delete(); } $counters = Counter::get(); foreach($counters as $counter){ $counter->qty = 0; $counter->save(); } $privacyPolicy = PrivacyPolicyTranslation::where('lang_code', 'en')->first(); if($privacyPolicy){ $privacyPolicy->privacy_policy = ''; $privacyPolicy->save(); } $termsAndCondition = TermsAndConditionTranslation::where('lang_code', 'en')->first(); if($termsAndCondition){ $termsAndCondition->terms_and_condition = ''; $termsAndCondition->save(); } $aboutUs = AboutUsTranslation::where('lang_code', 'en')->first(); if($privacyPolicy){ $aboutUs->about_us = ''; $aboutUs->service = ''; $aboutUs->history = ''; $aboutUs->save(); } Artisan::call('optimize:clear'); $notification = __('Database Cleared Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; } else { $notification = __('Passwords do not match.'); $notification = ['messege' => $notification, 'alert-type' => 'error']; } return redirect()->back()->with($notification); } public function customCode() { checkAdminHasPermissionAndThrowException('setting.view'); $customCode = CustomCode::first(); if (! $customCode) { $customCode = new CustomCode(); $customCode->css = '//write your css code here without the style tag'; $customCode->javascript = '//write your javascript here without the script tag'; $customCode->save(); } return view('globalsetting::custom_code', compact('customCode')); } public function customCodeUpdate(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $customCode = CustomCode::first(); if (! $customCode) { $customCode = new CustomCode(); } $customCode->css = $request->css; $customCode->javascript = $request->javascript; $customCode->save(); $notification = __('Updated Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update_maintenance_mode_status() { checkAdminHasPermissionAndThrowException('setting.update'); $status = $this->cachedSetting?->maintenance_mode == 1 ? 0 : 1; Setting::where('key', 'maintenance_mode')->update(['value' => $status]); Cache::forget('setting'); return response()->json([ 'success' => true, 'message' => __('Updated Successfully'), ]); } public function update_maintenance_mode(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'maintenance_title' => 'required', 'maintenance_description' => 'required', ], [ 'maintenance_title' => __('Maintenance Mode Title is required'), 'maintenance_description' => __('Maintenance Mode Description is required'), ]); if ($request->file('maintenance_image')) { $file_name = file_upload($request->maintenance_image, 'uploads/website-images/', $this->cachedSetting?->maintenance_image); Setting::where('key', 'maintenance_image')->update(['value' => $file_name]); } Setting::where('key', 'maintenance_title')->update(['value' => $request->maintenance_title]); Setting::where('key', 'maintenance_description')->update(['value' => $request->maintenance_description]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function systemUpdate() { $zipLoaded = extension_loaded('zip'); $updateFileDetails = false; $files = false; $uploadFileSize = false; $zipFilePath = public_path('upload/update.zip'); if ($updateFileDetails = File::exists($zipFilePath)) { $uploadFileSize = File::size($zipFilePath); $files = $this->getFilesFromZip($zipFilePath); } return view('globalsetting::auto-update', compact('updateFileDetails', 'uploadFileSize', 'files', 'zipLoaded')); } public function systemUpdateStore(Request $request) { $request->validate([ 'zip_file' => 'required|mimes:zip', ]); $zipFilePath = public_path('upload/update.zip'); if (File::exists($zipFilePath)) { File::delete($zipFilePath); } // Store the uploaded file $zipFile = $request->file('zip_file'); $zipFilePath = $zipFile->move(public_path('upload'), 'update.zip'); if (!$this->isFirstDirUpload($zipFilePath)) { File::delete($zipFilePath); $notification = __('Invalid Update File Structure'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } return back(); } public function systemUpdateRedirect() { $zipFilePath = public_path('upload/update.zip'); $zip = new ZipArchive; if ($zip->open($zipFilePath) !== true) { File::delete($zipFilePath); $notification = __('Corrupted Zip File'); $notification = ['messege' => $notification, 'alert-type' => 'error']; $zip->close(); return redirect()->back()->with($notification); } if (!$this->isFirstDirUpload($zipFilePath)) { $notification = __('Invalid Update File Structure'); $notification = ['messege' => $notification, 'alert-type' => 'error']; $zip->close(); return redirect()->back()->with($notification); } $zip->close(); $this->deleteFolderAndFiles(base_path('update')); if ($zip->open($zipFilePath) === true) { $zip->extractTo(base_path()); $zip->close(); } return redirect(url('/update')); } public function systemUpdateDelete() { $zipFilePath = public_path('upload/update.zip'); File::delete($zipFilePath); $this->deleteFolderAndFiles(base_path('update')); $notification = __('Deleted Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return back()->with($notification); } private function getFilesFromZip($zipFilePath) { $files = []; $zip = new ZipArchive; if ($zip->open($zipFilePath) === true) { for ($i = 0; $i < $zip->numFiles; $i++) { $fileInfo = $zip->statIndex($i); $files[] = $fileInfo['name']; } } $zip->close(); return $files; } private function deleteFolderAndFiles($dir) { if (!is_dir($dir)) { return; } $files = array_diff(scandir($dir), ['.', '..']); foreach ($files as $file) { $path = $dir . '/' . $file; if (is_dir($path)) { $this->deleteFolderAndFiles($path); } else { unlink($path); } } rmdir($dir); } private function isFirstDirUpload($zipFilePath) { $zip = new ZipArchive; if ($zip->open($zipFilePath) === TRUE) { $firstDir = null; for ($i = 0; $i < $zip->numFiles; $i++) { $fileInfo = $zip->statIndex($i); $filePathParts = explode('/', $fileInfo['name']); if (count($filePathParts) > 1) { $firstDir = $filePathParts[0]; break; } } $zip->close(); return $firstDir === "update"; } $zip->close(); return false; } } app/Http/Controllers/.gitkeep 0000644 00000000000 15012236406 0012167 0 ustar 00 app/Http/Controllers/EmailSettingController.php 0000644 00000014226 15012236406 0015717 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Http\Controllers; use App\Http\Controllers\Controller; use App\Traits\GlobalMailTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; use Modules\GlobalSetting\app\Models\EmailTemplate; use Modules\GlobalSetting\app\Models\Setting; class EmailSettingController extends Controller { use GlobalMailTrait; public function email_config() { checkAdminHasPermissionAndThrowException('setting.view'); $excludedIds = [6, 7, 8, 9]; $templates = EmailTemplate::whereNotIn('id', $excludedIds)->get(); return view('globalsetting::email.email_config', compact('templates')); } public function update_email_config(Request $request) { checkAdminHasPermissionAndThrowException('setting.update'); $request->validate([ 'mail_sender_name' => 'required', 'mail_host' => 'required', 'mail_sender_email' => 'required', 'mail_username' => 'required', 'mail_password' => 'required', 'mail_port' => 'required|numeric', 'mail_encryption' => 'required', ], [ 'mail_sender_name.required' => __('Sender name is required'), 'mail_host.required' => __('Mail host is required'), 'mail_sender_email.required' => __('Email is required'), 'mail_username.required' => __('Smtp username is required'), 'mail_password.unique' => __('Smtp password is required'), 'mail_port.required' => __('Mail port is required'), 'mail_port.numeric' => __('Mail port must be a number'), 'mail_encryption.required' => __('Mail encryption is required'), ]); Setting::where('key', 'mail_sender_name')->update(['value' => $request->mail_sender_name]); Setting::where('key', 'mail_host')->update(['value' => $request->mail_host]); Setting::where('key', 'mail_sender_email')->update(['value' => $request->mail_sender_email]); Setting::where('key', 'mail_username')->update(['value' => $request->mail_username]); Setting::where('key', 'mail_password')->update(['value' => $request->mail_password]); Setting::where('key', 'mail_port')->update(['value' => $request->mail_port]); Setting::where('key', 'mail_encryption')->update(['value' => $request->mail_encryption]); Cache::forget('setting'); $notification = __('Update Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function edit_email_template($id) { checkAdminHasPermissionAndThrowException('setting.view'); $template = EmailTemplate::where('id', $id)->first(); if ($template->name == 'password_reset') { return view('globalsetting::email.template.password_reset', compact('template')); } elseif ($template->name == 'contact_mail') { return view('globalsetting::email.template.contact_mail', compact('template')); } elseif ($template->name == 'contact_mail_for_agent') { return view('globalsetting::email.template.agent_contact_mail', compact('template')); } elseif ($template->name == 'subscribe_notification') { return view('globalsetting::email.template.subscribe_notification', compact('template')); } elseif ($template->name == 'social_login') { return view('globalsetting::email.template.social_login', compact('template')); } elseif ($template->name == 'user_verification') { return view('globalsetting::email.template.user_verification', compact('template')); } elseif ($template->name == 'approved_refund') { return view('globalsetting::email.template.refund_approval', compact('template')); } elseif ($template->name == 'new_refund') { return view('globalsetting::email.template.new_refund', compact('template')); } elseif ($template->name == 'pending_wallet_payment') { return view('globalsetting::email.template.pending_wallet_payment', compact('template')); } elseif ($template->name == 'approved_withdraw') { return view('globalsetting::email.template.approved_withdraw', compact('template')); } else { $notification = __('Something went wrong'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } } public function update_email_template(Request $request, $id) { checkAdminHasPermissionAndThrowException('setting.update'); $rules = [ 'subject' => 'required', 'message' => 'required', ]; $customMessages = [ 'subject.required' => __('Subject is required'), 'message.required' => __('Message is required'), ]; $request->validate($rules, $customMessages); $template = EmailTemplate::find($id); if ($template) { $template->subject = $request->subject; $template->message = $request->message; $template->save(); $notification = __('Updated Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->route('admin.email-configuration')->with($notification); } else { $notification = __('Something went wrong'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } } public function test_mail_credentials() { abort_unless(checkAdminHasPermission('setting.view'), 403); try { $this->sendMail('example@gmail.com', 'Test Email', 'This is a test email'); $notification = __('Mail Sent Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } catch (\Exception $e) { return $this->handleMailException($e); } } } app/Http/Controllers/error_log 0000644 00000001336 15012236406 0012470 0 ustar 00 [09-May-2025 00:45:13 UTC] PHP Fatal error: Uncaught Error: Class "App\Http\Controllers\Controller" not found in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/app/Http/Controllers/GlobalSettingController.php:75 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/app/Http/Controllers/GlobalSettingController.php on line 75 [09-May-2025 03:18:36 UTC] PHP Fatal error: Uncaught Error: Class "App\Http\Controllers\Controller" not found in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/app/Http/Controllers/ManageAddonController.php:21 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/GlobalSetting/app/Http/Controllers/ManageAddonController.php on line 21 app/Http/Requests/.gitkeep 0000644 00000000000 15012236406 0011474 0 ustar 00 app/Http/Middleware/.gitkeep 0000644 00000000000 15012236406 0011736 0 ustar 00 app/Models/SectionControl.php 0000644 00000000764 15012236406 0012233 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\GlobalSetting\Database\factories\SectionControlFactory; class SectionControl extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): SectionControlFactory { //return SectionControlFactory::new(); } } app/Models/EmailTemplate.php 0000644 00000000455 15012236406 0012006 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class EmailTemplate extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; } app/Models/CustomPagination.php 0000644 00000000460 15012236406 0012543 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CustomPagination extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; } app/Models/SeoSetting.php 0000644 00000001660 15012236406 0011346 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Cache; use Modules\GlobalSetting\Database\factories\SeoSettingFactory; class SeoSetting extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): SeoSettingFactory { // return SeoSettingFactory::new(); } public static function boot() { parent::boot(); static::saved(function () { Cache::forget('setting'); }); static::created(function () { Cache::forget('setting'); }); static::updated(function () { Cache::forget('setting'); }); static::deleted(function () { Cache::forget('setting'); }); } } app/Models/.gitkeep 0000644 00000000000 15012236406 0010165 0 ustar 00 app/Models/BackgroundImage.php 0000644 00000000770 15012236406 0012305 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\GlobalSetting\Database\factories\BackgroundImageFactory; class BackgroundImage extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): BackgroundImageFactory { //return BackgroundImageFactory::new(); } } app/Models/Setting.php 0000644 00000000447 15012236406 0010701 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Setting extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; } app/Models/CustomCode.php 0000644 00000000475 15012236406 0011332 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CustomCode extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['css', 'javascript']; } app/Traits/ArchiveHelperTrait.php 0000644 00000004262 15012236406 0013033 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Traits; use ZipArchive; trait ArchiveHelperTrait { private function isFirstDirAddons($zipFilePath) { $zip = new ZipArchive; if ($zip->open($zipFilePath) === true) { $firstDir = null; for ($i = 0; $i < $zip->numFiles; $i++) { $fileInfo = $zip->statIndex($i); $filePathParts = explode('/', $fileInfo['name']); if (count($filePathParts) > 1) { $firstDir = $filePathParts[0]; break; } } $zip->close(); return $firstDir === 'Modules'; } $zip->close(); return false; } private function checkAndReadJsonFile($zipPath, $searchFile = 'wsus.json') { $zip = new ZipArchive(); if ($zip->open($zipPath) === true) { $found = false; for ($i = 0; $i < $zip->numFiles; $i++) { $entry = $zip->getNameIndex($i); $pathInfo = explode('/', $entry); if (count($pathInfo) === 3 && $pathInfo[0] === 'Modules') { if (strpos($entry, $searchFile) !== false) { $found = true; $wsusJsonContent = $zip->getFromName($entry); if (json_decode($wsusJsonContent) !== null) { return json_decode($wsusJsonContent); } else { return false; } break; } } } if (! $found) { return false; } $zip->close(); } return false; } private function deleteFolderAndFiles($dir) { if (! is_dir($dir)) { return; } $files = array_diff(scandir($dir), ['.', '..']); foreach ($files as $file) { $path = $dir.'/'.$file; if (is_dir($path)) { $this->deleteFolderAndFiles($path); } else { unlink($path); } } rmdir($dir); } } app/Enums/WebsiteSettingEnum.php 0000644 00000056337 15012236406 0012726 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Enums; use Illuminate\Support\Collection; use Carbon\Carbon; use Illuminate\Support\Facades\Cache; enum WebsiteSettingEnum: string { public static function allTimeZones(): Collection { $timezones = [ (object) ['name' => 'Africa/Abidjan'], (object) ['name' => 'Africa/Accra'], (object) ['name' => 'Africa/Addis_Ababa'], (object) ['name' => 'Africa/Algiers'], (object) ['name' => 'Africa/Asmara'], (object) ['name' => 'Africa/Bamako'], (object) ['name' => 'Africa/Bangui'], (object) ['name' => 'Africa/Banjul'], (object) ['name' => 'Africa/Bissau'], (object) ['name' => 'Africa/Blantyre'], (object) ['name' => 'Africa/Brazzaville'], (object) ['name' => 'Africa/Bujumbura'], (object) ['name' => 'Africa/Cairo'], (object) ['name' => 'Africa/Casablanca'], (object) ['name' => 'Africa/Ceuta'], (object) ['name' => 'Africa/Conakry'], (object) ['name' => 'Africa/Dakar'], (object) ['name' => 'Africa/Dar_es_Salaam'], (object) ['name' => 'Africa/Djibouti'], (object) ['name' => 'Africa/Douala'], (object) ['name' => 'Africa/El_Aaiun'], (object) ['name' => 'Africa/Freetown'], (object) ['name' => 'Africa/Gaborone'], (object) ['name' => 'Africa/Harare'], (object) ['name' => 'Africa/Johannesburg'], (object) ['name' => 'Africa/Juba'], (object) ['name' => 'Africa/Kampala'], (object) ['name' => 'Africa/Khartoum'], (object) ['name' => 'Africa/Kigali'], (object) ['name' => 'Africa/Kinshasa'], (object) ['name' => 'Africa/Lagos'], (object) ['name' => 'Africa/Libreville'], (object) ['name' => 'Africa/Lome'], (object) ['name' => 'Africa/Luanda'], (object) ['name' => 'Africa/Lubumbashi'], (object) ['name' => 'Africa/Lusaka'], (object) ['name' => 'Africa/Malabo'], (object) ['name' => 'Africa/Maputo'], (object) ['name' => 'Africa/Maseru'], (object) ['name' => 'Africa/Mbabane'], (object) ['name' => 'Africa/Mogadishu'], (object) ['name' => 'Africa/Monrovia'], (object) ['name' => 'Africa/Nairobi'], (object) ['name' => 'Africa/Ndjamena'], (object) ['name' => 'Africa/Niamey'], (object) ['name' => 'Africa/Nouakchott'], (object) ['name' => 'Africa/Ouagadougou'], (object) ['name' => 'Africa/Porto-Novo'], (object) ['name' => 'Africa/Sao_Tome'], (object) ['name' => 'Africa/Tripoli'], (object) ['name' => 'Africa/Tunis'], (object) ['name' => 'Africa/Windhoek'], (object) ['name' => 'America/Adak'], (object) ['name' => 'America/Anchorage'], (object) ['name' => 'America/Anguilla'], (object) ['name' => 'America/Antigua'], (object) ['name' => 'America/Araguaina'], (object) ['name' => 'America/Argentina/Buenos_Aires'], (object) ['name' => 'America/Argentina/Catamarca'], (object) ['name' => 'America/Argentina/Cordoba'], (object) ['name' => 'America/Argentina/Jujuy'], (object) ['name' => 'America/Argentina/La_Rioja'], (object) ['name' => 'America/Argentina/Mendoza'], (object) ['name' => 'America/Argentina/Rio_Gallegos'], (object) ['name' => 'America/Argentina/Salta'], (object) ['name' => 'America/Argentina/San_Juan'], (object) ['name' => 'America/Argentina/San_Luis'], (object) ['name' => 'America/Argentina/Tucuman'], (object) ['name' => 'America/Argentina/Ushuaia'], (object) ['name' => 'America/Aruba'], (object) ['name' => 'America/Asuncion'], (object) ['name' => 'America/Atikokan'], (object) ['name' => 'America/Bahia'], (object) ['name' => 'America/Bahia_Banderas'], (object) ['name' => 'America/Barbados'], (object) ['name' => 'America/Belem'], (object) ['name' => 'America/Belize'], (object) ['name' => 'America/Blanc-Sablon'], (object) ['name' => 'America/Boa_Vista'], (object) ['name' => 'America/Bogota'], (object) ['name' => 'America/Boise'], (object) ['name' => 'America/Cambridge_Bay'], (object) ['name' => 'America/Campo_Grande'], (object) ['name' => 'America/Cancun'], (object) ['name' => 'America/Caracas'], (object) ['name' => 'America/Cayenne'], (object) ['name' => 'America/Cayman'], (object) ['name' => 'America/Chicago'], (object) ['name' => 'America/Chihuahua'], (object) ['name' => 'America/Costa_Rica'], (object) ['name' => 'America/Creston'], (object) ['name' => 'America/Cuiaba'], (object) ['name' => 'America/Curacao'], (object) ['name' => 'America/Danmarkshavn'], (object) ['name' => 'America/Dawson'], (object) ['name' => 'America/Dawson_Creek'], (object) ['name' => 'America/Denver'], (object) ['name' => 'America/Detroit'], (object) ['name' => 'America/Dominica'], (object) ['name' => 'America/Edmonton'], (object) ['name' => 'America/Eirunepe'], (object) ['name' => 'America/El_Salvador'], (object) ['name' => 'America/Fort_Nelson'], (object) ['name' => 'America/Fortaleza'], (object) ['name' => 'America/Glace_Bay'], (object) ['name' => 'America/Goose_Bay'], (object) ['name' => 'America/Grand_Turk'], (object) ['name' => 'America/Grenada'], (object) ['name' => 'America/Guadeloupe'], (object) ['name' => 'America/Guatemala'], (object) ['name' => 'America/Guayaquil'], (object) ['name' => 'America/Guyana'], (object) ['name' => 'America/Halifax'], (object) ['name' => 'America/Havana'], (object) ['name' => 'America/Hermosillo'], (object) ['name' => 'America/Indiana/Indianapolis'], (object) ['name' => 'America/Indiana/Knox'], (object) ['name' => 'America/Indiana/Marengo'], (object) ['name' => 'America/Indiana/Petersburg'], (object) ['name' => 'America/Indiana/Tell_City'], (object) ['name' => 'America/Indiana/Vevay'], (object) ['name' => 'America/Indiana/Vincennes'], (object) ['name' => 'America/Indiana/Winamac'], (object) ['name' => 'America/Inuvik'], (object) ['name' => 'America/Iqaluit'], (object) ['name' => 'America/Jamaica'], (object) ['name' => 'America/Juneau'], (object) ['name' => 'America/Kentucky/Louisville'], (object) ['name' => 'America/Kentucky/Monticello'], (object) ['name' => 'America/Kralendijk'], (object) ['name' => 'America/La_Paz'], (object) ['name' => 'America/Lima'], (object) ['name' => 'America/Los_Angeles'], (object) ['name' => 'America/Lower_Princes'], (object) ['name' => 'America/Maceio'], (object) ['name' => 'America/Nuuk'], (object) ['name' => 'America/Ojinaga'], (object) ['name' => 'America/Panama'], (object) ['name' => 'America/Pangnirtung'], (object) ['name' => 'America/Paramaribo'], (object) ['name' => 'America/Phoenix'], (object) ['name' => 'America/Port-au-Prince'], (object) ['name' => 'America/Port_of_Spain'], (object) ['name' => 'America/Porto_Velho'], (object) ['name' => 'America/Puerto_Rico'], (object) ['name' => 'America/Punta_Arenas'], (object) ['name' => 'America/Rainy_River'], (object) ['name' => 'America/Rankin_Inlet'], (object) ['name' => 'America/Recife'], (object) ['name' => 'America/Regina'], (object) ['name' => 'America/Resolute'], (object) ['name' => 'America/Rio_Branco'], (object) ['name' => 'America/Santarem'], (object) ['name' => 'America/Santiago'], (object) ['name' => 'America/Santo_Domingo'], (object) ['name' => 'America/Sao_Paulo'], (object) ['name' => 'America/Scoresbysund'], (object) ['name' => 'America/Sitka'], (object) ['name' => 'America/St_Barthelemy'], (object) ['name' => 'America/St_Johns'], (object) ['name' => 'America/St_Kitts'], (object) ['name' => 'America/St_Lucia'], (object) ['name' => 'America/St_Thomas'], (object) ['name' => 'America/St_Vincent'], (object) ['name' => 'America/Swift_Current'], (object) ['name' => 'America/Tegucigalpa'], (object) ['name' => 'America/Thule'], (object) ['name' => 'America/Thunder_Bay'], (object) ['name' => 'America/Tijuana'], (object) ['name' => 'America/Toronto'], (object) ['name' => 'America/Tortola'], (object) ['name' => 'America/Vancouver'], (object) ['name' => 'America/Whitehorse'], (object) ['name' => 'America/Winnipeg'], (object) ['name' => 'America/Yakutat'], (object) ['name' => 'America/Yellowknife'], (object) ['name' => 'Antarctica/Casey'], (object) ['name' => 'Antarctica/Davis'], (object) ['name' => 'Antarctica/DumontDUrville'], (object) ['name' => 'Antarctica/Macquarie'], (object) ['name' => 'Antarctica/Mawson'], (object) ['name' => 'Antarctica/McMurdo'], (object) ['name' => 'Antarctica/Palmer'], (object) ['name' => 'Antarctica/Rothera'], (object) ['name' => 'Antarctica/Syowa'], (object) ['name' => 'Antarctica/Troll'], (object) ['name' => 'Antarctica/Vostok'], (object) ['name' => 'Arctic/Longyearbyen'], (object) ['name' => 'Asia/Aden'], (object) ['name' => 'Asia/Almaty'], (object) ['name' => 'Asia/Amman'], (object) ['name' => 'Asia/Anadyr'], (object) ['name' => 'Asia/Aqtau'], (object) ['name' => 'Asia/Aqtobe'], (object) ['name' => 'Asia/Ashgabat'], (object) ['name' => 'Asia/Atyrau'], (object) ['name' => 'Asia/Baghdad'], (object) ['name' => 'Asia/Bahrain'], (object) ['name' => 'Asia/Baku'], (object) ['name' => 'Asia/Bangkok'], (object) ['name' => 'Asia/Barnaul'], (object) ['name' => 'Asia/Beirut'], (object) ['name' => 'Asia/Bishkek'], (object) ['name' => 'Asia/Brunei'], (object) ['name' => 'Asia/Chita'], (object) ['name' => 'Asia/Choibalsan'], (object) ['name' => 'Asia/Colombo'], (object) ['name' => 'Asia/Damascus'], (object) ['name' => 'Asia/Dhaka'], (object) ['name' => 'Asia/Dili'], (object) ['name' => 'Asia/Dubai'], (object) ['name' => 'Asia/Dushanbe'], (object) ['name' => 'Asia/Famagusta'], (object) ['name' => 'Asia/Gaza'], (object) ['name' => 'Asia/Hebron'], (object) ['name' => 'Asia/Ho_Chi_Minh'], (object) ['name' => 'Asia/Hong_Kong'], (object) ['name' => 'Asia/Hovd'], (object) ['name' => 'Asia/Irkutsk'], (object) ['name' => 'Asia/Jakarta'], (object) ['name' => 'Asia/Jayapura'], (object) ['name' => 'Asia/Jerusalem'], (object) ['name' => 'Asia/Kabul'], (object) ['name' => 'Asia/Kamchatka'], (object) ['name' => 'Asia/Karachi'], (object) ['name' => 'Asia/Kathmandu'], (object) ['name' => 'Asia/Khandyga'], (object) ['name' => 'Asia/Kolkata'], (object) ['name' => 'Asia/Krasnoyarsk'], (object) ['name' => 'Asia/Kuala_Lumpur'], (object) ['name' => 'Asia/Kuching'], (object) ['name' => 'Asia/Kuwait'], (object) ['name' => 'Asia/Macau'], (object) ['name' => 'Asia/Magadan'], (object) ['name' => 'Asia/Makassar'], (object) ['name' => 'Asia/Manila'], (object) ['name' => 'Asia/Muscat'], (object) ['name' => 'Asia/Nicosia'], (object) ['name' => 'Asia/Novokuznetsk'], (object) ['name' => 'Asia/Novosibirsk'], (object) ['name' => 'Asia/Omsk'], (object) ['name' => 'Asia/Oral'], (object) ['name' => 'Asia/Phnom_Penh'], (object) ['name' => 'Asia/Pontianak'], (object) ['name' => 'Asia/Pyongyang'], (object) ['name' => 'Asia/Qatar'], (object) ['name' => 'Asia/Qostanay'], (object) ['name' => 'Asia/Qyzylorda'], (object) ['name' => 'Asia/Riyadh'], (object) ['name' => 'Asia/Sakhalin'], (object) ['name' => 'Asia/Samarkand'], (object) ['name' => 'Asia/Seoul'], (object) ['name' => 'Asia/Shanghai'], (object) ['name' => 'Asia/Singapore'], (object) ['name' => 'Asia/Srednekolymsk'], (object) ['name' => 'Asia/Taipei'], (object) ['name' => 'Asia/Tashkent'], (object) ['name' => 'Asia/Tbilisi'], (object) ['name' => 'Asia/Tehran'], (object) ['name' => 'Asia/Thimphu'], (object) ['name' => 'Asia/Tokyo'], (object) ['name' => 'Asia/Tomsk'], (object) ['name' => 'Asia/Ulaanbaatar'], (object) ['name' => 'Asia/Urumqi'], (object) ['name' => 'Asia/Ust-Nera'], (object) ['name' => 'Asia/Vientiane'], (object) ['name' => 'Asia/Vladivostok'], (object) ['name' => 'Asia/Yakutsk'], (object) ['name' => 'Asia/Yangon'], (object) ['name' => 'Asia/Yekaterinburg'], (object) ['name' => 'Asia/Yerevan'], (object) ['name' => 'Atlantic/Azores'], (object) ['name' => 'Atlantic/Bermuda'], (object) ['name' => 'Atlantic/Canary'], (object) ['name' => 'Atlantic/Cape_Verde'], (object) ['name' => 'Atlantic/Faroe'], (object) ['name' => 'Atlantic/Madeira'], (object) ['name' => 'Atlantic/Reykjavik'], (object) ['name' => 'Atlantic/South_Georgia'], (object) ['name' => 'Atlantic/St_Helena'], (object) ['name' => 'Atlantic/Stanley'], (object) ['name' => 'Australia/Adelaide'], (object) ['name' => 'Australia/Brisbane'], (object) ['name' => 'Australia/Broken_Hill'], (object) ['name' => 'Australia/Darwin'], (object) ['name' => 'Australia/Eucla'], (object) ['name' => 'Australia/Hobart'], (object) ['name' => 'Australia/Lindeman'], (object) ['name' => 'Australia/Lord_Howe'], (object) ['name' => 'Australia/Melbourne'], (object) ['name' => 'Australia/Perth'], (object) ['name' => 'Australia/Sydney'], (object) ['name' => 'Europe/Amsterdam'], (object) ['name' => 'Europe/Andorra'], (object) ['name' => 'Europe/Astrakhan'], (object) ['name' => 'Europe/Athens'], (object) ['name' => 'Europe/Belgrade'], (object) ['name' => 'Europe/Berlin'], (object) ['name' => 'Europe/Bratislava'], (object) ['name' => 'Europe/Brussels'], (object) ['name' => 'Europe/Bucharest'], (object) ['name' => 'Europe/Budapest'], (object) ['name' => 'Europe/Busingen'], (object) ['name' => 'Europe/Chisinau'], (object) ['name' => 'Europe/Copenhagen'], (object) ['name' => 'Europe/Dublin'], (object) ['name' => 'Europe/Gibraltar'], (object) ['name' => 'Europe/Guernsey'], (object) ['name' => 'Europe/Helsinki'], (object) ['name' => 'Europe/Isle_of_Man'], (object) ['name' => 'Europe/Istanbul'], (object) ['name' => 'Europe/Jersey'], (object) ['name' => 'Europe/Kaliningrad'], (object) ['name' => 'Europe/Kiev'], (object) ['name' => 'Europe/Kirov'], (object) ['name' => 'Europe/Lisbon'], (object) ['name' => 'Europe/Ljubljana'], (object) ['name' => 'Europe/London'], (object) ['name' => 'Europe/Luxembourg'], (object) ['name' => 'Europe/Madrid'], (object) ['name' => 'Europe/Malta'], (object) ['name' => 'Europe/Mariehamn'], (object) ['name' => 'Europe/Minsk'], (object) ['name' => 'Europe/Monaco'], (object) ['name' => 'Europe/Moscow'], (object) ['name' => 'Europe/Oslo'], (object) ['name' => 'Europe/Paris'], (object) ['name' => 'Europe/Podgorica'], (object) ['name' => 'Europe/Prague'], (object) ['name' => 'Europe/Riga'], (object) ['name' => 'Europe/Rome'], (object) ['name' => 'Europe/Samara'], (object) ['name' => 'Europe/San_Marino'], (object) ['name' => 'Europe/Sarajevo'], (object) ['name' => 'Europe/Saratov'], (object) ['name' => 'Europe/Simferopol'], (object) ['name' => 'Europe/Skopje'], (object) ['name' => 'Europe/Sofia'], (object) ['name' => 'Europe/Stockholm'], (object) ['name' => 'Europe/Tallinn'], (object) ['name' => 'Europe/Tirane'], (object) ['name' => 'Europe/Ulyanovsk'], (object) ['name' => 'Europe/Uzhgorod'], (object) ['name' => 'Europe/Vaduz'], (object) ['name' => 'Europe/Vatican'], (object) ['name' => 'Europe/Vienna'], (object) ['name' => 'Europe/Vilnius'], (object) ['name' => 'Europe/Volgograd'], (object) ['name' => 'Europe/Warsaw'], (object) ['name' => 'Europe/Zagreb'], (object) ['name' => 'Europe/Zaporozhye'], (object) ['name' => 'Europe/Zurich'], (object) ['name' => 'Indian/Antananarivo'], (object) ['name' => 'Indian/Chagos'], (object) ['name' => 'Indian/Christmas'], (object) ['name' => 'Indian/Cocos'], (object) ['name' => 'Indian/Comoro'], (object) ['name' => 'Indian/Kerguelen'], (object) ['name' => 'Indian/Mahe'], (object) ['name' => 'Indian/Maldives'], (object) ['name' => 'Indian/Mauritius'], (object) ['name' => 'Indian/Mayotte'], (object) ['name' => 'Indian/Reunion'], (object) ['name' => 'Pacific/Apia'], (object) ['name' => 'Pacific/Auckland'], (object) ['name' => 'Pacific/Bougainville'], (object) ['name' => 'Pacific/Chatham'], (object) ['name' => 'Pacific/Chuuk'], (object) ['name' => 'Pacific/Easter'], (object) ['name' => 'Pacific/Efate'], (object) ['name' => 'Pacific/Enderbury'], (object) ['name' => 'Pacific/Fakaofo'], (object) ['name' => 'Pacific/Fiji'], (object) ['name' => 'Pacific/Funafuti'], (object) ['name' => 'Pacific/Galapagos'], (object) ['name' => 'Pacific/Gambier'], (object) ['name' => 'Pacific/Guadalcanal'], (object) ['name' => 'Pacific/Guam'], (object) ['name' => 'Pacific/Honolulu'], (object) ['name' => 'Pacific/Kiritimati'], (object) ['name' => 'Pacific/Kosrae'], (object) ['name' => 'Pacific/Kwajalein'], (object) ['name' => 'Pacific/Majuro'], (object) ['name' => 'Pacific/Marquesas'], (object) ['name' => 'Pacific/Midway'], (object) ['name' => 'Pacific/Nauru'], (object) ['name' => 'Pacific/Niue'], (object) ['name' => 'Pacific/Norfolk'], (object) ['name' => 'Pacific/Noumea'], (object) ['name' => 'Pacific/Pago_Pago'], (object) ['name' => 'Pacific/Palau'], (object) ['name' => 'Pacific/Pitcairn'], (object) ['name' => 'Pacific/Pohnpei'], (object) ['name' => 'Pacific/Port_Moresby'], (object) ['name' => 'Pacific/Rarotonga'], (object) ['name' => 'Pacific/Saipan'], (object) ['name' => 'Pacific/Tahiti'], (object) ['name' => 'Pacific/Tarawa'], (object) ['name' => 'Pacific/Tongatapu'], (object) ['name' => 'Pacific/Wake'], (object) ['name' => 'Pacific/Wallis'], (object) ['name' => 'UTC'], ]; return collect( $timezones ); } public static function allTimeFormat() :array { return [ 'H:i:s' => 'H:i:s (24-hour format with leading zeros, e.g., ' . self::now()->format('H:i:s') . ')', 'h:i:s A' => 'h:i:s A (12-hour format with leading zeros and AM/PM, e.g., ' . self::now()->format('h:i:s A') . ')', 'h:i A' => 'h:i A (12-hour format with leading zeros and AM/PM, e.g., ' . self::now()->format('h:i A') . ')', 'H:i' => 'H:i (24-hour format with leading zeros, e.g., ' . self::now()->format('H:i') . ')', 'g:i:s A' => 'g:i:s A (12-hour format without leading zeros and AM/PM, e.g., ' . self::now()->format('g:i:s A') . ')', 'g:i A' => 'g:i A (12-hour format without leading zeros and AM/PM, e.g., ' . self::now()->format('g:i A') . ')', 'h:i A' => 'h:i A (12-hour format with leading zeros and AM/PM, e.g., ' . self::now()->format('h:i A') . ')', ]; } public static function allDateFormat() :array { return [ 'Y-m-d' => 'Y-m-d (Year-month-day, e.g., ' . self::now()->format('Y-m-d') . ')', 'd-m-Y' => 'd-m-Y (Day-month-year, e.g., ' . self::now()->format('d-m-Y') . ')', 'm/d/Y' => 'm/d/Y (Month/day/year, e.g., ' . self::now()->format('m/d/Y') . ')', 'd/m/Y' => 'd/m/Y (Day/month/year, e.g., ' . self::now()->format('d/m/Y') . ')', 'Y年m月d日' => 'Y年m月d日 (Year年month月day日, e.g., ' . self::now()->format('Y年m月d日') . ')', 'Y/m/d' => 'Y/m/d (Year/month/day, e.g., ' . self::now()->format('Y/m/d') . ')', 'd.m.Y' => 'd.m.Y (Day.month.Year, e.g., ' . self::now()->format('d.m.Y') . ')', 'l, d F Y' => 'l, d F Y (Full textual representation of the day, day of the month, month, year, e.g., ' . self::now()->format('l, d F Y') . ')', 'd-M-Y' => 'd-M-Y (Day-Month-Year, e.g., ' . self::now()->format('d-M-Y') . ')', 'Y/m/d D' => 'Y/m/d D (Year/month/day Day, e.g., ' . self::now()->format('Y/m/d D') . ')', 'jS F Y' => 'jS F Y (Day without leading zeros, month, year, e.g., ' . self::now()->format('jS F Y') . ')', 'D, M jS Y' => 'D, M jS Y (Day, month, day without leading zeros, year, e.g., ' . self::now()->format('D, M jS Y') . ')', ]; } public static function now() { return Carbon::now(config('app.timezone')); } } app/Providers/RouteServiceProvider.php 0000644 00000002713 15012236406 0014146 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { /** * The module namespace to assume when generating URLs to actions. */ protected string $moduleNamespace = 'Modules\GlobalSetting\app\Http\Controllers'; /** * Called before routes are registered. * * Register any model bindings or pattern based filters. */ public function boot(): void { parent::boot(); } /** * Define the routes for the application. */ public function map(): void { $this->mapApiRoutes(); $this->mapWebRoutes(); } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. */ protected function mapWebRoutes(): void { Route::middleware('web') ->namespace($this->moduleNamespace) ->group(module_path('GlobalSetting', '/routes/web.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. */ protected function mapApiRoutes(): void { Route::prefix('api') ->middleware('api') ->namespace($this->moduleNamespace) ->group(module_path('GlobalSetting', '/routes/api.php')); } } app/Providers/.gitkeep 0000644 00000000000 15012236406 0010717 0 ustar 00 app/Providers/GlobalSettingServiceProvider.php 0000644 00000006472 15012236406 0015614 0 ustar 00 <?php namespace Modules\GlobalSetting\app\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; class GlobalSettingServiceProvider extends ServiceProvider { protected string $moduleName = 'GlobalSetting'; protected string $moduleNameLower = 'globalsetting'; /** * Boot the application events. */ public function boot(): void { $this->registerCommands(); $this->registerCommandSchedules(); $this->registerTranslations(); $this->registerConfig(); $this->registerViews(); $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); } /** * Register the service provider. */ public function register(): void { $this->app->register(RouteServiceProvider::class); } /** * Register commands in the format of Command::class */ protected function registerCommands(): void { // $this->commands([]); } /** * Register command Schedules. */ protected function registerCommandSchedules(): void { // $this->app->booted(function () { // $schedule = $this->app->make(Schedule::class); // $schedule->command('inspire')->hourly(); // }); } /** * Register translations. */ public function registerTranslations(): void { $langPath = resource_path('lang/modules/'.$this->moduleNameLower); if (is_dir($langPath)) { $this->loadTranslationsFrom($langPath, $this->moduleNameLower); $this->loadJsonTranslationsFrom($langPath); } else { $this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower); $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang')); } } /** * Register config. */ protected function registerConfig(): void { $this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config'); $this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower); } /** * Register views. */ public function registerViews(): void { $viewPath = resource_path('views/modules/'.$this->moduleNameLower); $sourcePath = module_path($this->moduleName, 'resources/views'); $this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']); $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); $componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.config('modules.paths.generator.component-class.path')); Blade::componentNamespace($componentNamespace, $this->moduleNameLower); } /** * Get the services provided by the provider. */ public function provides(): array { return []; } private function getPublishableViewPaths(): array { $paths = []; foreach (config('view.paths') as $path) { if (is_dir($path.'/modules/'.$this->moduleNameLower)) { $paths[] = $path.'/modules/'.$this->moduleNameLower; } } return $paths; } } app/Helpers/helpers.php 0000644 00000002732 15012236406 0011104 0 ustar 00 <?php use Carbon\Carbon; use Illuminate\Support\Facades\Cache; use Modules\GlobalSetting\app\Enums\WebsiteSettingEnum; if(!function_exists('carbonNowWithTimeZone')){ function carbonNowWithTimeZone() { return WebsiteSettingEnum::now(); } } if (!function_exists('timezone')) { function timezone() { return Cache::has('setting') ? Cache::get('setting')->timezone ?? config('app.timezone') : config('app.timezone'); } } if (!function_exists('timeFormat')) { function timeFormat() { return Cache::has('setting') ? Cache::get('setting')->time_format ?? 'h:i A' : 'h:i A'; } } if (!function_exists('dateFormat')) { function dateFormat() { return Cache::has('setting') ? Cache::get('setting')->date_format ?? 'Y-m-d' : 'Y-m-d'; } } if (!function_exists('formattedDate')) { function formattedDate($date) { return $date instanceof Carbon ? $date->setTimezone(timezone())->format(dateFormat()) : Carbon::parse($date)->setTimezone(timezone())->format(dateFormat()); } } if (!function_exists('formattedTime')) { function formattedTime($time) { return $time instanceof Carbon ? $time->setTimezone(timezone())->format(timeFormat()) : Carbon::parse($time)->setTimezone(timezone())->format(timeFormat()); } } if (!function_exists('formattedDateTime')) { function formattedDateTime($datetime) { return formattedDate($datetime) . ' - ' . formattedTime($datetime); } } database/factories/.gitkeep 0000644 00000000000 15012236406 0011705 0 ustar 00 database/migrations/2023_11_06_094842_create_custom_paginations_table.php 0000644 00000001212 15012236406 0021676 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('custom_paginations', function (Blueprint $table) { $table->id(); $table->string('section_name'); $table->integer('item_qty')->default(1); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('custom_paginations'); } }; database/migrations/.gitkeep 0000644 00000000000 15012236406 0012102 0 ustar 00 database/migrations/2024_07_29_040526_create_section_controls_table.php 0000644 00000001451 15012236406 0021365 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('section_controls', function (Blueprint $table) { $table->id(); $table->string('page_name')->nullable(); $table->string('section_name')->nullable(); $table->string('title')->nullable(); $table->boolean('status')->default(true); $table->integer('qty')->default(0); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('section_controls'); } }; database/migrations/2023_11_06_043247_create_settings_table.php 0000644 00000001135 15012236406 0017625 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('settings', function (Blueprint $table) { $table->id(); $table->string('key'); $table->string('value'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('settings'); } }; database/migrations/2024_01_03_092007_create_custom_codes_table.php 0000644 00000001176 15012236406 0020454 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('custom_codes', function (Blueprint $table) { $table->id(); $table->text('css')->nullable(); $table->text('javascript')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('custom_codes'); } }; database/migrations/error_log 0000644 00000004750 15012236406 0012406 0 ustar 00 [16-May-2025 06:38:20 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2024_01_03_092007_create_custom_codes_table.php:7 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2024_01_03_092007_create_custom_codes_table.php on line 7 [16-May-2025 06:47:14 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2024_07_29_040526_create_section_controls_table.php:7 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2024_07_29_040526_create_section_controls_table.php on line 7 [16-May-2025 07:05:03 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2023_11_06_043247_create_settings_table.php:7 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2023_11_06_043247_create_settings_table.php on line 7 [16-May-2025 07:10:10 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2023_11_06_094842_create_custom_paginations_table.php:7 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2023_11_06_094842_create_custom_paginations_table.php on line 7 [16-May-2025 08:44:51 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2023_11_06_115856_create_email_templates_table.php:7 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2023_11_06_115856_create_email_templates_table.php on line 7 [16-May-2025 08:58:43 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2024_07_29_113528_create_background_images_table.php:7 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/migrations/2024_07_29_113528_create_background_images_table.php on line 7 database/migrations/2023_11_06_054251_create_seo_settings_table.php 0000644 00000001232 15012236406 0020466 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('seo_settings', function (Blueprint $table) { $table->id(); $table->string('page_name'); $table->text('seo_title'); $table->text('seo_description'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('seo_settings'); } }; database/migrations/2023_11_06_115856_create_email_templates_table.php 0000644 00000001227 15012236406 0021142 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('email_templates', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('subject'); $table->longText('message'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('email_templates'); } }; database/migrations/2024_07_29_113528_create_background_images_table.php 0000644 00000002071 15012236406 0021444 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('background_images', function (Blueprint $table) { $table->id(); $table->string('home1_top_property')->nullable(); $table->string('agent')->nullable(); $table->string('home1_testimonial')->nullable(); $table->string('home2_testimonial')->nullable(); $table->string('home3_testimonial')->nullable(); $table->string('home1_footer')->nullable(); $table->string('home2_footer')->nullable(); $table->string('home3_footer')->nullable(); $table->string('service_background_image')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('background_images'); } }; database/seeders/BackgroundImageSeeder.php 0000644 00000002017 15012236406 0014624 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; use Modules\GlobalSetting\app\Models\BackgroundImage; class BackgroundImageSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $bgImage = new BackgroundImage(); $bgImage->home1_top_property = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-6875.jpg'; $bgImage->agent = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-4626.jpg'; $bgImage->home1_testimonial = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-5937.jpg'; $bgImage->home3_testimonial = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-5305.jpg'; $bgImage->home1_footer = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-8585.jpg'; $bgImage->home2_footer = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-4094.jpg'; $bgImage->home3_footer = 'uploads/website-images/wsus-img-2024-08-15-08-24-38-9236.jpg'; $bgImage->save(); } } database/seeders/.gitkeep 0000644 00000000000 15012236406 0011360 0 ustar 00 database/seeders/EmailTemplateSeeder.php 0000644 00000010501 15012236406 0014322 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; use Modules\GlobalSetting\app\Models\EmailTemplate; class EmailTemplateSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $templates = [ [ 'name' => 'password_reset', 'subject' => 'Password Reset', 'message' => '<p>Dear {{user_name}},</p> <p>Do you want to reset your password? Please Click the following link and Reset Your Password.</p>', ], [ 'name' => 'contact_mail', 'subject' => 'Contact Email', 'message' => '<p>Hello there,</p> <p> Mr. {{name}} has sent a new message. you can see the message details below. </p> <p>Email: {{email}}</p> <p>Phone: {{phone}}</p> <p>Subject: {{subject}}</p> <p>Message: {{message}}</p>', ], [ 'name' => 'subscribe_notification', 'subject' => 'Subscribe Notification', 'message' => '<p>Hi there, Congratulations! Your Subscription has been created successfully. Please Click the following link and Verified Your Subscription. If you will not approve this link, you can not get any newsletter from us.</p>', ], [ 'name' => 'social_login', 'subject' => 'Social Login', 'message' => '<p>Hello {{user_name}},</p> <p>Welcome to {{app_name}}! Your account has been created successfully.</p> <p>Your password: {{password}}</p> <p>You can log in to your account at <a href="https://websolutionus.com">https://websolutionus.com</a></p> <p>Thank you for joining us.</p>', ], [ 'name' => 'user_verification', 'subject' => 'User Verification', 'message' => '<p>Dear {{user_name}},</p> <p>Congratulations! Your account has been created successfully. Please click the following link to activate your account.</p>', ], [ 'name' => 'approved_refund', 'subject' => 'Refund Request Approval', 'message' => '<p>Dear {{user_name}},</p> <p>We are happy to say that, we have send {{refund_amount}} USD to your provided bank information. </p>', ], [ 'name' => 'new_refund', 'subject' => 'New Refund Request', 'message' => '<p>Hello websolutionus, </p> <p>Mr. {{user_name}} has send a new refund request to you.</p>', ], [ 'name' => 'pending_wallet_payment', 'subject' => 'Wallet Payment Approval', 'message' => '<p>Hello {{user_name}},</p> <p>We have received your wallet payment request. we find your payment to our bank account.</p> <p>Thanks & Regards</p>', ], [ 'name' => 'approved_withdraw', 'subject' => 'Withdraw Request Approval', 'message' => '<p>Dear {{user_name}},</p> <p>We are happy to say that, we have send a withdraw amount to your provided bank information.</p> <p>Thanks & Regards</p> <p>WebSolutionUs</p>', ], [ 'name' => 'contact_mail_for_agent', 'subject' => 'Agent Contact Email', 'message' => '<p>Hello there,</p> <p> Mr. {{name}} has sent a new message. you can see the message details below. </p> <p>Email: {{email}}</p> <p>Phone: {{phone}}</p> <p>Subject: {{subject}}</p> <p>Property Name: {{property}}</p> <p>Message: {{message}}</p>', ], ]; foreach ($templates as $index => $template) { $new_template = new EmailTemplate(); $new_template->name = $template['name']; $new_template->subject = $template['subject']; $new_template->message = $template['message']; $new_template->save(); } } } database/seeders/GlobalSettingInfoSeeder.php 0000644 00000010126 15012236406 0015154 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; use Modules\GlobalSetting\app\Models\Setting; class GlobalSettingInfoSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $setting_data = [ 'app_name' => 'WebSolutionUs', 'version' => '3.2', 'logo' => 'uploads/website-images/logo.png', 'timezone' => 'Asia/Dhaka', 'date_format' => 'Y-m-d', 'time_format' => 'h:i A', 'favicon' => 'uploads/website-images/favicon.png', 'cookie_status' => 'active', 'border' => 'normal', 'corners' => 'thin', 'background_color' => '#184dec', 'text_color' => '#fafafa', 'border_color' => '#0a58d6', 'btn_bg_color' => '#fffceb', 'btn_text_color' => '#222758', 'link_text' => 'More Info', 'btn_text' => 'Yes', 'message' => 'This website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only upon approval.', 'copyright_text' => 'this is copyright text', 'recaptcha_site_key' => 'recaptcha_site_key', 'recaptcha_secret_key' => 'recaptcha_secret_key', 'recaptcha_status' => 'inactive', 'tawk_status' => 'inactive', 'tawk_chat_link' => 'tawk_chat_link', 'googel_tag_status' => 'inactive', 'googel_tag_id' => 'google_tag_id', 'google_analytic_status' => 'active', 'google_analytic_id' => 'google_analytic_id', 'pixel_status' => 'inactive', 'pixel_app_id' => 'pixel_app_id', 'google_login_status' => 'inactive', 'gmail_client_id' => 'google_client_id', 'gmail_secret_id' => 'google_secret_id', 'default_avatar' => 'uploads/website-images/wsus-img-2024-08-15-09-10-53-5804.png', 'breadcrumb_image' => 'uploads/website-images/wsus-img-2024-08-15-09-11-19-9897.jpg', 'mail_host' => 'sandbox.smtp.mailtrap.io', 'mail_sender_email' => 'sender@gmail.com', 'mail_username' => 'mail_username', 'mail_password' => 'mail_password', 'mail_port' => 2525, 'mail_encryption' => 'ssl', 'mail_sender_name' => 'WebSolutionUs', 'contact_message_receiver_mail' => 'receiver@gmail.com', 'pusher_app_id' => 'pusher_app_id', 'pusher_app_key' => 'pusher_app_key', 'pusher_app_secret' => 'pusher_app_secret', 'pusher_app_cluster' => 'pusher_app_cluster', 'pusher_status' => 'inactive', 'club_point_rate' => 1, 'club_point_status' => 'active', 'maintenance_mode' => 0, 'maintenance_image' => 'uploads/website-images/maintenance.jpg', 'maintenance_title' => 'Website Under maintenance', 'maintenance_description' => '<p>We are currently performing maintenance on our website to<br>improve your experience. Please check back later.</p> <p><a title="Websolutions" href="https://websolutionus.com/">Websolutions</a></p>', 'last_update_date' => date('Y-m-d H:i:s'), 'is_queable' => 'inactive', 'comments_auto_approved' => 'active', 'selected_theme' => 'all_theme', 'home1_footer_logo' =>'uploads/website-images/wsus-img-2024-08-15-08-25-16-5127.png', 'home2_logo' => 'uploads/website-images/wsus-img-2024-08-15-08-25-16-5550.png', 'home3_logo' => 'uploads/website-images/wsus-img-2024-08-15-08-25-16-2027.png', 'theme1_primary_color' => '#1b6eea', 'theme2_primary_color' => '#ff5a3c', 'theme3_primary_color' => '#27ae60', ]; foreach ($setting_data as $index => $setting_item) { $new_item = new Setting(); $new_item->key = $index; $new_item->value = $setting_item; $new_item->save(); } } } database/seeders/SectionControlSeeder.php 0000644 00000004455 15012236406 0014557 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; use Modules\GlobalSetting\app\Models\SectionControl; class SectionControlSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $item1 = new SectionControl(); $item1->page_name = 'Home One'; $item1->section_name = "slider"; $item1->title = "Slider"; $item1->save(); $item2 = new SectionControl(); $item2->page_name = 'Home One'; $item2->section_name = "about_us"; $item2->title = "About Us"; $item2->save(); $item3 = new SectionControl(); $item3->page_name = 'Home One'; $item3->section_name = "urgent_property"; $item3->title = "Urgent Property"; $item3->qty = 9; $item3->save(); $item4 = new SectionControl(); $item4->page_name = 'Home One'; $item4->section_name = "top_property"; $item4->title = "Top Properties"; $item4->qty = 9; $item4->save(); $item5 = new SectionControl(); $item5->page_name = 'Home One'; $item5->section_name = "featured_property"; $item5->title = "Featured Properties"; $item5->qty = 9; $item5->save(); $item6 = new SectionControl(); $item6->page_name = 'Home One'; $item6->section_name = "agent"; $item6->title = "Agent"; $item6->qty = 4; $item6->save(); $item7 = new SectionControl(); $item7->page_name = 'Home One'; $item7->section_name = "service"; $item7->title = "Service"; $item7->qty = 4; $item7->save(); $item8 = new SectionControl(); $item8->page_name = 'Home One'; $item8->section_name = "blog"; $item8->title = "Blog"; $item8->qty = 3; $item8->save(); $item9 = new SectionControl(); $item9->page_name = 'Home One'; $item9->section_name = "testimonial"; $item9->title = "Testimonials"; $item9->qty = 6; $item9->save(); $item10 = new SectionControl(); $item10->page_name = 'Home One'; $item10->section_name = "our_team"; $item10->title = "Our Team"; $item10->qty = 4; $item10->save(); } } database/seeders/error_log 0000644 00000003326 15012236406 0011662 0 ustar 00 [16-May-2025 06:26:03 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/SectionControlSeeder.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/SectionControlSeeder.php on line 8 [16-May-2025 06:49:01 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/CustomPaginationSeeder.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/CustomPaginationSeeder.php on line 8 [16-May-2025 07:05:02 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/BackgroundImageSeeder.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/BackgroundImageSeeder.php on line 8 [16-May-2025 08:03:46 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/SeoInfoSeeder.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/SeoInfoSeeder.php on line 8 [16-May-2025 12:17:43 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/EmailTemplateSeeder.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/GlobalSetting/database/seeders/EmailTemplateSeeder.php on line 8 database/seeders/GlobalSettingDatabaseSeeder.php 0000644 00000000407 15012236406 0015766 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; class GlobalSettingDatabaseSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } database/seeders/SeoInfoSeeder.php 0000644 00000004233 15012236406 0013146 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; use Modules\GlobalSetting\app\Models\SeoSetting; class SeoInfoSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $item1 = new SeoSetting(); $item1->page_name = 'Home Page'; $item1->seo_title = 'Home || WebSolutionUS'; $item1->seo_description = 'Home || TopLand'; $item1->save(); $item2 = new SeoSetting(); $item2->page_name = 'About Page'; $item2->seo_title = 'About || WebSolutionUS'; $item2->seo_description = 'About || TopLand'; $item2->save(); $item3 = new SeoSetting(); $item3->page_name = 'Property Page'; $item3->seo_title = 'All Properties || TopLand'; $item3->seo_description = 'All Properties || TopLand'; $item3->save(); $item4 = new SeoSetting(); $item4->page_name = 'Pricing Plan'; $item4->seo_title = 'Pricing Plan || TopLand'; $item4->seo_description = 'Pricing Plan || TopLand'; $item4->save(); $item5 = new SeoSetting(); $item5->page_name = 'Agent Page'; $item5->seo_title = 'Agent Page || TopLand'; $item5->seo_description = 'Agent Page || TopLand'; $item5->save(); $item6 = new SeoSetting(); $item6->page_name = 'Blog Page'; $item6->seo_title = 'Blog Page || TopLand'; $item6->seo_description = 'Blog Page || TopLand'; $item6->save(); $item7 = new SeoSetting(); $item7->page_name = 'Contact us'; $item7->seo_title = 'Contact us || TopLand'; $item7->seo_description = 'Contact us || TopLand'; $item7->save(); $item8 = new SeoSetting(); $item8->page_name = 'FAQ Page'; $item8->seo_title = 'FAQ Page || TopLand'; $item8->seo_description = 'FAQ Page || TopLand'; $item8->save(); $item8 = new SeoSetting(); $item8->page_name = 'Career Page'; $item8->seo_title = 'Career Page || TopLand'; $item8->seo_description = 'Career Page || TopLand'; $item8->save(); } } database/seeders/CustomPaginationSeeder.php 0000644 00000002146 15012236406 0015071 0 ustar 00 <?php namespace Modules\GlobalSetting\database\seeders; use Illuminate\Database\Seeder; use Modules\GlobalSetting\app\Models\CustomPagination; class CustomPaginationSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $item1 = new CustomPagination(); $item1->section_name = 'Blog List'; $item1->item_qty = 6; $item1->save(); $item2 = new CustomPagination(); $item2->section_name = 'Blog Comment'; $item2->item_qty = 10; $item2->save(); $item3 = new CustomPagination(); $item3->section_name = 'Language List'; $item3->item_qty = 10; $item3->save(); $item4 = new CustomPagination(); $item4->section_name = 'Property'; $item4->item_qty = 12; $item4->save(); $item5 = new CustomPagination(); $item5->section_name = 'Agent'; $item5->item_qty = 8; $item5->save(); $item6 = new CustomPagination(); $item6->section_name = 'Career'; $item6->item_qty = 6; $item6->save(); } } resources/assets/.gitkeep 0000644 00000000000 15012236406 0011476 0 ustar 00 resources/assets/js/app.js 0000644 00000000000 15012236406 0011577 0 ustar 00 resources/assets/sass/app.scss 0000644 00000000000 15012236406 0012473 0 ustar 00 resources/views/sidebar.blade.php 0000644 00000004111 15012236406 0013077 0 ustar 00 <li class="menu-header">{{ __('Settings') }}</li> <li class="{{ Route::is('admin.general-setting') ? 'active' : '' }}"><a class="nav-link" href="{{ route('admin.general-setting') }}"><i class="fas fa-cog"></i> <span>{{ __('General Settings') }}</span></a></li> <li class="{{ Route::is('admin.crediential-setting') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.crediential-setting') }}"><i class="fas fa-key"></i> <span>{{ __('Credential Settings') }}</span> </a> </li> <li class="{{ Route::is('admin.email-configuration') || Route::is('admin.edit-email-template') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.email-configuration') }}"><i class="fas fa-envelope"></i> <span>{{ __('Email Configuration') }}</span> </a> </li> @if (Module::isEnabled('Language') && checkAdminHasPermission('language.view')) @include('language::sidebar') @endif <li class="{{ Route::is('admin.seo-setting') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.seo-setting') }}"><i class="fas fa-search"></i> <span>{{ __('SEO Setup') }}</span> </a> </li> <li class="menu-header">{{ __('Extra Settings') }}</li> <li class="{{ Route::is('admin.cache-clear') ? 'active' : '' }}"><a class="nav-link" href="{{ route('admin.cache-clear') }}"><i class="fas fa-sync"></i> <span>{{ __('Clear cache') }}</span> </a></li> <li class="{{ Route::is('admin.database-clear') ? 'active' : '' }}"><a class="nav-link" href="{{ route('admin.database-clear') }}"><i class="fas fa-database"></i> <span>{{ __('Database Clear') }}</span></a></li> <li class="{{ Route::is('admin.system-update.index') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.system-update.index') }}"><i class="fas fa-arrow-circle-up"></i> <span>{{ __('System Update') }}</span> </a> </li> <li class="{{ Route::is('admin.addons.*') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.addons.view') }}"><i class="fas fa-plug"></i> <span>{{ __('Manage Addons') }}</span> </a> </li> resources/views/seo_setting.blade.php 0000644 00000013344 15012236406 0014021 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('SEO Setup') }}</title> @endsection @section('admin-content') <!-- Main Content --> <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('SEO Setup') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Settings') => route('admin.settings'), __('SEO Setup') => '#', ]" /> <div class="section-body"> <div class="col"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-12 col-sm-12 col-md-3"> <ul class="nav nav-pills flex-column" id="seo_tab" role="tablist"> @foreach ($pages as $index => $page) <li class="nav-item border rounded mb-1"> <a class="nav-link {{ $index == 0 ? 'active' : '' }}" id="error-tab-{{ $page->id }}" data-bs-toggle="tab" href="#errorTab-{{ $page->id }}" role="tab" aria-controls="errorTab-{{ $page->id }}" aria-selected="true">{{ $page->page_name }}</a> </li> @endforeach </ul> </div> <div class="col-12 col-sm-12 col-md-9"> <div class="border rounded"> <div class="tab-content no-padding" id="settingsContent"> @foreach ($pages as $index => $page) <div class="tab-pane fade {{ $index == 0 ? 'show active' : '' }}" id="errorTab-{{ $page->id }}" role="tabpanel" aria-labelledby="error-tab-{{ $page->id }}"> <div class="card m-0"> <div class="card-body"> <form action="{{ route('admin.update-seo-setting', $page->id) }}" method="POST"> @method('PUT') @csrf <div class="row"> <div class="col-12"> <div class="form-group"> <x-admin.form-input id="seo_title" name="seo_title" label="{{ __('SEO Title') }}" placeholder="{{ __('Enter SEO Title') }}" value="{{ $page->seo_title }}" /> </div> </div> <div class="col-12"> <div class="form-group"> <x-admin.form-textarea id="seo_description" name="seo_description" label="{{ __('SEO Description') }}" placeholder="{{ __('Enter SEO Description') }}" value="{{ $page->seo_description }}" maxlength="1000" /> </div> </div> </div> <x-admin.update-button :text="__('Update')" /> </form> </div> </div> </div> @endforeach </div> </div> </div> </div> </div> </div> </div> </div> </section> </div> @endsection @push('js') <script> //Tab active setup locally $(document).ready(function() { activeTabSetupLocally('seo_tab') }); </script> @endpush resources/views/addons/manage_addon.blade.php 0000644 00000013727 15012236406 0015350 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Manage Addons') }}</title> @endsection @section('admin-content') <!-- Main Content --> <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Manage Addons') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Settings') => route('admin.settings'), __('Manage Addons') => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4>{{ __('Manage Addons') }}</h4> <div class="card-header-action"> @adminCan('addon.install') <a class="btn btn-success" href="{{ route('admin.addons.install') }}"><i class="fas fa-plus"></i> {{ __('Install New') }}</a> @endadminCan </div> </div> <div class="card-body"> <div class="row"> @forelse ($addons as $addon) @php $options = json_decode($addon->options, true); // Decode as an associative array $route = isset($options['setting_route']) && count($options) > 0 ? $options['setting_route'] : false; @endphp <div class="text-center col-lg-3 col-md-6 col-sm-12"> <div class="p-1 border card"> <div class="card-body"> @if ($addon->icon) <img src="{{ $addon->icon }}" alt=""> @endif <h4>{{ $addon->name }}</h4> <p class="card-text">{{ $addon->description }}</p> <p class="card-text">{{ __('version') }}: {{ $addon->version }}</p> <p class="card-text">{{ __('Update') }}: {{ $addon->last_update }} </p> @if ($addon->is_default) <button class="btn btn-success" type="button" disabled>{{ __('Installed') }}</button> @else @if ($route && $addon->status && Route::has($route)) <a class="btn btn-primary" href="{{ route($route) }}" target="_blank" rel="noopener noreferrer"> <i class="fas fa-cogs"></i> </a> @endif @if ($addon->status) <a class="btn btn-warning" href="{{ route('admin.addons.update.status', $addon->slug) }}">{{ __('Disable') }}</a> @else <a class="btn btn-success" href="{{ route('admin.addons.update.status', $addon->slug) }}">{{ __('Enable') }}</a> @endif <a class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal" href="{{ route('admin.addons.uninstall', $addon->slug) }}" onclick="deleteData('{{ route('admin.addons.uninstall', $addon->slug) }}')">{{ __('Uninstall') }}</a> @endif </div> </div> </div> @empty <table class="table table-striped"> <tbody> <x-empty-table :name="__('Post')" route="" create="no" :message="__('No data found!')" colspan="1" /> </tbody> </table> @endforelse </div> </div> </div> </div> </div> </div> </section> </div> <x-admin.delete-modal /> @endsection @push('js') <script> "use strict"; function deleteData(url) { $("#deleteForm").attr("action", url) } </script> @endpush resources/views/addons/install_addon.blade.php 0000644 00000033333 15012236406 0015561 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Install Addon') }}</title> @endsection @section('admin-content') <!-- Main Content --> <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Install Addon') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Settings') => route('admin.settings'), __('Install Addon') => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4>{{ __('Install Addon') }}</h4> <div class="card-header-action"> @adminCan('addon.view') <a href="{{ route('admin.addons.view') }}" class="btn btn-success"><i class="fas fa-plug"></i> {{ __('Manage Addons') }}</a> @endadminCan </div> </div> <div class="card-body"> <div class="row"> <div class="col-12"> <div class="box"> <form action="{{ route('admin.addons.store') }}" method="POST" enctype="multipart/form-data" class="d-flex justify-content-center"> @csrf <input class="drag-input" type="file" data_btn_text="Browse" placeholder="drage and drop file here" accept="application/zip" name="zip_file" /> <button class="btn btn-primary"><i class="fa fa-upload"></i> {{ __('Upload') }}</button> </form> </div> </div> @if ($addonFiles) <div class="mt-3 col-12"> <hr> @foreach ($addonFiles as $fileName => $jsonInfo) <div class="card"> <div class="card-body"> <div class="row"> <div class="col-12"> @if (is_object($jsonInfo)) <p>{{ __('Name') }}: {{ $jsonInfo->name }}</p> <p>{{ __('Description') }}: {{ $jsonInfo->description }} </p> <p>{{ __('Author') }}: {{ $jsonInfo?->author?->name }} </p> <p>{{ __('Email') }}: {{ $jsonInfo?->author?->email }} </p> <p>{{ __('version') }}: {{ $jsonInfo->version }}</p> <p>{{ __('Last Update') }}: {{ $jsonInfo->last_update }} </p> @endif </div> <div class="col-12"> <div class="d-flex justify-items-center justify-content-between "> <form action="{{ route('admin.addons.install.start') }}" method="post"> @csrf <button class="btn btn-primary"> {{ __('Start Install Process') }} </button> </form> <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#deleteModal" onclick="deleteData()" class="btn btn-danger">{{ __('Delete Update File') }}</a> </div> </div> </div> </div> </div> @endforeach </div> @endif </div> </div> </div> </div> </div> </div> </section> </div> <x-admin.delete-modal /> @endsection @push('css') <style> .kwt-file__drop-area { position: relative; display: flex; align-items: center; width: 280px; padding: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); transition: 0.3s; } .kwt-file__drop-area.is-active { background-color: #d1def0; } .kwt-file__choose-file { flex-shrink: 0; background-color: #1d3557; margin-right: 10px; color: #ffffff; display: flex; align-items: center; justify-content: center; } .kwt-file__choose-file.kwt-file_btn-text { border-radius: 4px; width: auto; height: auto; padding: 10px 20px; font-size: 14px; } .kwt-file__msg { color: #1d3557; font-size: 16px; font-weight: 400; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .kwt-file__input { position: absolute; left: 0; top: 0; height: 100%; width: 100%; cursor: pointer; opacity: 0; } .kwt-file__input:focus { outline: none; } .kwt-file__delete { display: none; position: absolute; right: 10px; width: 18px; height: 18px; cursor: pointer; } .kwt-file__delete:before { content: ""; position: absolute; left: 0; transition: 0.3s; top: 0; z-index: 1; width: 100%; height: 100%; background-size: cover; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg fill='%231d3557' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438.5 438.5'%3e%3cpath d='M417.7 75.7A8.9 8.9 0 00411 73H323l-20-47.7c-2.8-7-8-13-15.4-18S272.5 0 264.9 0h-91.3C166 0 158.5 2.5 151 7.4c-7.4 5-12.5 11-15.4 18l-20 47.7H27.4a9 9 0 00-6.6 2.6 9 9 0 00-2.5 6.5v18.3c0 2.7.8 4.8 2.5 6.6a8.9 8.9 0 006.6 2.5h27.4v271.8c0 15.8 4.5 29.3 13.4 40.4a40.2 40.2 0 0032.3 16.7H338c12.6 0 23.4-5.7 32.3-17.2a64.8 64.8 0 0013.4-41V109.6h27.4c2.7 0 4.9-.8 6.6-2.5a8.9 8.9 0 002.6-6.6V82.2a9 9 0 00-2.6-6.5zm-248.4-36a8 8 0 014.9-3.2h90.5a8 8 0 014.8 3.2L283.2 73H155.3l14-33.4zm177.9 340.6a32.4 32.4 0 01-6.2 19.3c-1.4 1.6-2.4 2.4-3 2.4H100.5c-.6 0-1.6-.8-3-2.4a32.5 32.5 0 01-6.1-19.3V109.6h255.8v270.7z'/%3e%3cpath d='M137 347.2h18.3c2.7 0 4.9-.9 6.6-2.6a9 9 0 002.5-6.6V173.6a9 9 0 00-2.5-6.6 8.9 8.9 0 00-6.6-2.6H137c-2.6 0-4.8.9-6.5 2.6a8.9 8.9 0 00-2.6 6.6V338c0 2.7.9 4.9 2.6 6.6a8.9 8.9 0 006.5 2.6zM210.1 347.2h18.3a8.9 8.9 0 009.1-9.1V173.5c0-2.7-.8-4.9-2.5-6.6a8.9 8.9 0 00-6.6-2.6h-18.3a8.9 8.9 0 00-9.1 9.1V338a8.9 8.9 0 009.1 9.1zM283.2 347.2h18.3c2.7 0 4.8-.9 6.6-2.6a8.9 8.9 0 002.5-6.6V173.6c0-2.7-.8-4.9-2.5-6.6a8.9 8.9 0 00-6.6-2.6h-18.3a9 9 0 00-6.6 2.6 8.9 8.9 0 00-2.5 6.6V338a9 9 0 002.5 6.6 9 9 0 006.6 2.6z'/%3e%3c/svg%3e"); } .kwt-file__delete:after { content: ""; position: absolute; opacity: 0; left: 50%; top: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) scale(0); background-color: #1d3557; border-radius: 50%; transition: 0.3s; } .kwt-file__delete:hover:after { transform: translate(-50%, -50%) scale(2.2); opacity: 0.1; } </style> @endpush @push('js') <script> "use strict"; function deleteData() { $("#deleteForm").attr("action", "{{ url('admin/settings/addons/delete') }}") } //drag and drop script (function($) { /** * Create drag and drop element. */ var customDragandDrop = function(element) { $(element).addClass("kwt-file__input"); var element = $(element).wrap( `<div class="kwt-file"><div class="kwt-file__drop-area"><span class='kwt-file__choose-file ${ element.attributes.data_btn_text ? "" === element.attributes.data_btn_text.textContent ? "" : "kwt-file_btn-text" : "" }'>Browse</span>${element.outerHTML}</span><span class="kwt-file__msg">${ "" === element.placeholder ? "or drop files here" : `${element.placeholder}` }</span><div class="kwt-file__delete"></div></div></div>` ); var element = element.parents(".kwt-file"); // Add class on focus and drage enter event. element.on("dragenter focus click", ".kwt-file__input", function(e) { $(this).parents(".kwt-file__drop-area").addClass("is-active"); }); // Remove class on blur and drage leave event. element.on("dragleave blur drop", ".kwt-file__input", function(e) { $(this).parents(".kwt-file__drop-area").removeClass("is-active"); }); // Show filename when change file. element.on("change", ".kwt-file__input", function(e) { let filesCount = $(this)[0].files.length; let textContainer = $(this).next(".kwt-file__msg"); if (1 === filesCount) { let fileName = $(this).val().split("\\").pop(); textContainer .text(fileName) .next(".kwt-file__delete") .css("display", "block"); } else { textContainer.text( `${ "" === this[0].placeholder ? "or drop files here" : `${this[0].placeholder}` }` ); $(this) .parents(".kwt-file") .find(".kwt-file__delete") .css("display", "none"); } }); // Delete selected file. element.on("click", ".kwt-file__delete", function(e) { let deleteElement = $(this); deleteElement.parents(".kwt-file").find(`.kwt-file__input`).val(null); deleteElement .css("display", "none") .prev(`.kwt-file__msg`) .text( `${ "" === $(this).parents(".kwt-file").find(".kwt-file__input")[0].placeholder ? "or drop files here" : `${ $(this).parents(".kwt-file").find(".kwt-file__input")[0].placeholder }` }` ); }); }; $.fn.kwtFileUpload = function(e) { var _this = $(this); $.each(_this, function(index, element) { customDragandDrop(element); }); return this; }; })(jQuery); // Plugin initialize jQuery(document).ready(function($) { $(".drag-input").kwtFileUpload(); }); </script> @endpush resources/views/.gitkeep 0000644 00000000000 15012236406 0011331 0 ustar 00 resources/views/auto-update.blade.php 0000644 00000030032 15012236406 0013717 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('System Update') . ' - ' . $setting->app_name ?? 'AppeyTech' }}</title> @endsection @section('admin-content') <!-- Main Content --> <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('System Update') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Settings') => route('admin.settings'), __('System Update') => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> @if ($zipLoaded) @if (!$files) <div class="row"> <div class="col-12"> <div class="box"> <form action="{{ route('admin.system-update.store') }}" method="POST" enctype="multipart/form-data" class="d-flex justify-content-center"> @csrf <input class="drag-input" type="file" data_btn_text="Browse" placeholder="drage and drop file here" accept="application/zip" name="zip_file" /> <button class="btn btn-primary"><i class="fa fa-upload"></i> {{ __('Upload') }}</button> </form> </div> </div> </div> @endif @if ($files) <div class="row"> <div class="my-3 border col-12"> <h2 class="pt-2">{{ __('Available Update File Structure') }}</h2> <hr> <ul class="mt-3 list-group file-preview-box"> @foreach ($files as $file) <li class="list-group-item">{{ $file }}</li> @endforeach </ul> </div> <div class="col-12"> <div class="d-flex justify-items-center justify-content-between "> <form action="{{ route('admin.system-update.redirect') }}" method="post"> @csrf <button class="btn btn-primary"> {{ __('Start Update Process') }} </button> </form> <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#deleteModal" onclick="deleteData()" class="btn btn-danger">{{ __('Delete Update File') }}</a> </div> </div> @endif @else <div class="row"> <div class="col-12 d-flex justify-content-center"> <h1>{{ __('PHP Extension Zip Not Loaded, Please Enable this first and then try again.') }} </h1> </div> </div> @endif </div> </div> </div> </div> </div> </section> </div> <x-admin.delete-modal /> @endsection @push('css') <style> .kwt-file__drop-area { position: relative; display: flex; align-items: center; width: 280px; padding: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); transition: 0.3s; } .kwt-file__drop-area.is-active { background-color: #d1def0; } .kwt-file__choose-file { flex-shrink: 0; background-color: #1d3557; margin-right: 10px; color: #ffffff; display: flex; align-items: center; justify-content: center; } .kwt-file__choose-file.kwt-file_btn-text { border-radius: 4px; width: auto; height: auto; padding: 10px 20px; font-size: 14px; } .kwt-file__msg { color: #1d3557; font-size: 16px; font-weight: 400; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .kwt-file__input { position: absolute; left: 0; top: 0; height: 100%; width: 100%; cursor: pointer; opacity: 0; } .kwt-file__input:focus { outline: none; } .kwt-file__delete { display: none; position: absolute; right: 10px; width: 18px; height: 18px; cursor: pointer; } .kwt-file__delete:before { content: ""; position: absolute; left: 0; transition: 0.3s; top: 0; z-index: 1; width: 100%; height: 100%; background-size: cover; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg fill='%231d3557' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438.5 438.5'%3e%3cpath d='M417.7 75.7A8.9 8.9 0 00411 73H323l-20-47.7c-2.8-7-8-13-15.4-18S272.5 0 264.9 0h-91.3C166 0 158.5 2.5 151 7.4c-7.4 5-12.5 11-15.4 18l-20 47.7H27.4a9 9 0 00-6.6 2.6 9 9 0 00-2.5 6.5v18.3c0 2.7.8 4.8 2.5 6.6a8.9 8.9 0 006.6 2.5h27.4v271.8c0 15.8 4.5 29.3 13.4 40.4a40.2 40.2 0 0032.3 16.7H338c12.6 0 23.4-5.7 32.3-17.2a64.8 64.8 0 0013.4-41V109.6h27.4c2.7 0 4.9-.8 6.6-2.5a8.9 8.9 0 002.6-6.6V82.2a9 9 0 00-2.6-6.5zm-248.4-36a8 8 0 014.9-3.2h90.5a8 8 0 014.8 3.2L283.2 73H155.3l14-33.4zm177.9 340.6a32.4 32.4 0 01-6.2 19.3c-1.4 1.6-2.4 2.4-3 2.4H100.5c-.6 0-1.6-.8-3-2.4a32.5 32.5 0 01-6.1-19.3V109.6h255.8v270.7z'/%3e%3cpath d='M137 347.2h18.3c2.7 0 4.9-.9 6.6-2.6a9 9 0 002.5-6.6V173.6a9 9 0 00-2.5-6.6 8.9 8.9 0 00-6.6-2.6H137c-2.6 0-4.8.9-6.5 2.6a8.9 8.9 0 00-2.6 6.6V338c0 2.7.9 4.9 2.6 6.6a8.9 8.9 0 006.5 2.6zM210.1 347.2h18.3a8.9 8.9 0 009.1-9.1V173.5c0-2.7-.8-4.9-2.5-6.6a8.9 8.9 0 00-6.6-2.6h-18.3a8.9 8.9 0 00-9.1 9.1V338a8.9 8.9 0 009.1 9.1zM283.2 347.2h18.3c2.7 0 4.8-.9 6.6-2.6a8.9 8.9 0 002.5-6.6V173.6c0-2.7-.8-4.9-2.5-6.6a8.9 8.9 0 00-6.6-2.6h-18.3a9 9 0 00-6.6 2.6 8.9 8.9 0 00-2.5 6.6V338a9 9 0 002.5 6.6 9 9 0 006.6 2.6z'/%3e%3c/svg%3e"); } .kwt-file__delete:after { content: ""; position: absolute; opacity: 0; left: 50%; top: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%) scale(0); background-color: #1d3557; border-radius: 50%; transition: 0.3s; } .kwt-file__delete:hover:after { transform: translate(-50%, -50%) scale(2.2); opacity: 0.1; } </style> @endpush @push('js') <script> "use strict"; function deleteData() { $("#deleteForm").attr("action", "{{ url('admin/system-update/delete') }}") } //drag and drop script (function($) { /** * Create drag and drop element. */ var customDragandDrop = function(element) { $(element).addClass("kwt-file__input"); var element = $(element).wrap( `<div class="kwt-file"><div class="kwt-file__drop-area"><span class='kwt-file__choose-file ${ element.attributes.data_btn_text ? "" === element.attributes.data_btn_text.textContent ? "" : "kwt-file_btn-text" : "" }'>Browse</span>${element.outerHTML}</span><span class="kwt-file__msg">${ "" === element.placeholder ? "or drop files here" : `${element.placeholder}` }</span><div class="kwt-file__delete"></div></div></div>` ); var element = element.parents(".kwt-file"); // Add class on focus and drage enter event. element.on("dragenter focus click", ".kwt-file__input", function(e) { $(this).parents(".kwt-file__drop-area").addClass("is-active"); }); // Remove class on blur and drage leave event. element.on("dragleave blur drop", ".kwt-file__input", function(e) { $(this).parents(".kwt-file__drop-area").removeClass("is-active"); }); // Show filename when change file. element.on("change", ".kwt-file__input", function(e) { let filesCount = $(this)[0].files.length; let textContainer = $(this).next(".kwt-file__msg"); if (1 === filesCount) { let fileName = $(this).val().split("\\").pop(); textContainer .text(fileName) .next(".kwt-file__delete") .css("display", "block"); } else { textContainer.text( `${ "" === this[0].placeholder ? "or drop files here" : `${this[0].placeholder}` }` ); $(this) .parents(".kwt-file") .find(".kwt-file__delete") .css("display", "none"); } }); // Delete selected file. element.on("click", ".kwt-file__delete", function(e) { let deleteElement = $(this); deleteElement.parents(".kwt-file").find(`.kwt-file__input`).val(null); deleteElement .css("display", "none") .prev(`.kwt-file__msg`) .text( `${ "" === $(this).parents(".kwt-file").find(".kwt-file__input")[0].placeholder ? "or drop files here" : `${ $(this).parents(".kwt-file").find(".kwt-file__input")[0].placeholder }` }` ); }); }; $.fn.kwtFileUpload = function(e) { var _this = $(this); $.each(_this, function(index, element) { customDragandDrop(element); }); return this; }; })(jQuery); // Plugin initialize jQuery(document).ready(function($) { $(".drag-input").kwtFileUpload(); }); </script> @endpush resources/views/credientials/tabs/navbar.blade.php 0000644 00000002507 15012236406 0016345 0 ustar 00 <li class="nav-item"> <a class="nav-link active show" id="google-recaptcha-tab" data-bs-toggle="tab" href="#google_recaptcha_tab" role="tab" aria-controls="google-recaptcha" aria-selected="false">{{ __('Google reCaptcha') }}</a> </li> <li class="nav-item"> <a class="nav-link" id="google-analytic-tab" data-bs-toggle="tab" href="#google_analytic_tab" role="tab" aria-controls="google-analytic" aria-selected="false">{{ __('Google Analytics') }}</a> </li> <li class="nav-item"> <a class="nav-link" id="googel-tag-tab" data-bs-toggle="tab" href="#googel_tag_tab" role="tab" aria-controls="googel-tag" aria-selected="false">{{ __('Google Tag Manager') }}</a> </li> <li class="nav-item"> <a class="nav-link" id="facebook-pixel-tab" data-bs-toggle="tab" href="#facebook_pixel_tab" role="tab" aria-controls="facebook-pixel" aria-selected="false">{{ __('Facebook Pixel') }}</a> </li> <li class="nav-item"> <a class="nav-link" id="social-login-tab" data-bs-toggle="tab" href="#social_login_tab" role="tab" aria-controls="social-login" aria-selected="false">{{ __('Social Login') }}</a> </li> <li class="nav-item"> <a class="nav-link" id="tawk-chat-tab" data-bs-toggle="tab" href="#tawk_chat_tab" role="tab" aria-controls="tawk-chat" aria-selected="false">{{ __('Tawk Chat') }}</a> </li> resources/views/credientials/index.blade.php 0000644 00000005062 15012236406 0015251 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Crediential Setting') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Credential Setting') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Settings') => route('admin.settings'), __('Credential Setting') => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-md-4"> <div class="card"> <div class="card-body"> <ul class="nav nav-pills flex-column" id="credientialTab" role="tablist"> @include('globalsetting::credientials.tabs.navbar') </ul> </div> </div> </div> <div class="col-md-8"> <div class="card"> <div class="card-body"> <div class="tab-content" id="myTabContent2"> @include('globalsetting::credientials.sections.google-recaptcha') @include('globalsetting::credientials.sections.google-tag') @include('globalsetting::credientials.sections.google-analytic') @include('globalsetting::credientials.sections.facebook-pixel') @include('globalsetting::credientials.sections.social-login') @include('globalsetting::credientials.sections.tawk-chat') @include('globalsetting::credientials.sections.pusher') </div> </div> </div> </div> </div> </div> </section> </div> @endsection @push('js') <script> "use strict"; $(document).ready(function() { $('#copyButton').on('click', function() { var copyText = $('#gmail_redirect_url'); copyText.select(); document.execCommand('copy'); toastr.success("{{ __('Copied to clipboard') }}"); }); //Tab active setup locally activeTabSetupLocally('credientialTab') }); </script> @endpush resources/views/credientials/sections/pusher.blade.php 0000644 00000002450 15012236406 0017275 0 ustar 00 <div class="tab-pane fade" id="pusher_tab" role="tabpanel"> <form action="{{ route('admin.update-pusher') }}" method="POST" enctype="multipart/form-data"> @csrf @method('PUT') <div class="form-group"> <x-admin.form-input id="pusher_app_id" name="pusher_app_id" label="{{ __('Pusher App ID') }}" value="{{ $setting->pusher_app_id }}"/> </div> <div class="form-group"> <x-admin.form-input id="pusher_app_key" name="pusher_app_key" label="{{ __('Pusher App Key') }}" value="{{ $setting->pusher_app_secret }}"/> </div> <div class="form-group"> <x-admin.form-input id="pusher_app_secret" name="pusher_app_secret" label="{{ __('Pusher App Secret') }}" value="{{ $setting->pusher_app_secret }}"/> </div> <div class="form-group"> <x-admin.form-input id="pusher_app_cluster" name="pusher_app_cluster" label="{{ __('Pusher App Cluster') }}" value="{{ $setting->pusher_app_cluster }}"/> </div> <div class="form-group"> <x-admin.form-switch name="pusher_status" label="{{ __('Status') }}" active_value="active" inactive_value="inactive" :checked="$setting->pusher_status == 'active'"/> </div> <x-admin.update-button :text="__('Update')" /> </form> </div> resources/views/credientials/sections/facebook-pixel.blade.php 0000644 00000001243 15012236406 0020656 0 ustar 00 <div class="tab-pane fade" id="facebook_pixel_tab" role="tabpanel"> <form action="{{ route('admin.update-facebook-pixel') }}" method="POST"> @csrf @method('PUT') <div class="form-group"> <x-admin.form-input id="pixel_app_id" name="pixel_app_id" label="{{ __('Facebook Pixel ID') }}" value="{{ $setting->pixel_app_id }}"/> </div> <div class="form-group"> <x-admin.form-switch name="pixel_status" label="{{ __('Status') }}" active_value="active" inactive_value="inactive" :checked="$setting->pixel_status == 'active'"/> </div> <x-admin.update-button :text="__('Update')" /> </form> </div>