Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/ContactUs.tar
Назад
lang/.gitkeep 0000644 00000000000 15012237604 0007104 0 ustar 00 module.json 0000644 00000000346 15012237604 0006727 0 ustar 00 { "name": "ContactUs", "alias": "contactus", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\ContactUs\\app\\Providers\\ContactUsServiceProvider" ], "files": [] } tests/Unit/.gitkeep 0000644 00000000000 15012237604 0010244 0 ustar 00 tests/Feature/.gitkeep 0000644 00000000000 15012237604 0010720 0 ustar 00 vite.config.js 0000644 00000001310 15012237604 0007310 0 ustar 00 import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: '../../public/build-contactus', emptyOutDir: true, manifest: true, }, plugins: [ laravel({ publicDirectory: '../../public', buildDirectory: 'build-contactus', 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', //]; routes/.gitkeep 0000644 00000000000 15012237604 0007504 0 ustar 00 routes/error_log 0000644 00000001114 15012237604 0007777 0 ustar 00 [07-May-2025 12:08:27 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/routes/api.php:17 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/routes/api.php on line 17 [07-May-2025 13:35:48 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/routes/web.php:18 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/routes/web.php on line 18 routes/web.php 0000644 00000001607 15012237604 0007357 0 ustar 00 <?php use Illuminate\Support\Facades\Route; use Modules\ContactUs\app\Http\Controllers\ContactUsController; use Modules\ContactUs\app\Http\Controllers\ContactInformationController; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::middleware(['auth:admin', 'translation']) ->name('admin.') ->prefix('admin') ->group( function () { Route::resource('contact-us-page', ContactUsController::class)->names('contact-us-page'); Route::resource('contact-information', ContactInformationController::class)->names('contact-information'); }); routes/api.php 0000644 00000001237 15012237604 0007352 0 ustar 00 <?php use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | is assigned the "api" middleware group. Enjoy building your API! | */ Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () { Route::get('contactus', fn (Request $request) => $request->user())->name('contactus'); }); composer.json 0000644 00000001311 15012237604 0007262 0 ustar 00 { "name": "nwidart/contactus", "description": "", "authors": [ { "name": "Nicolas Widart", "email": "n.widart@gmail.com" } ], "extra": { "laravel": { "providers": [], "aliases": { } } }, "autoload": { "psr-4": { "Modules\\ContactUs\\": "", "Modules\\ContactUs\\App\\": "app/", "Modules\\ContactUs\\Database\\Factories\\": "database/factories/", "Modules\\ContactUs\\Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Modules\\ContactUs\\Tests\\": "tests/" } } } config/config.php 0000644 00000000056 15012237604 0007770 0 ustar 00 <?php return [ 'name' => 'ContactUs', ]; config/.gitkeep 0000644 00000000000 15012237604 0007430 0 ustar 00 package.json 0000644 00000000410 15012237604 0007025 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/.gitkeep 0000644 00000000000 15012237604 0012170 0 ustar 00 app/Http/Controllers/ContactUsController.php 0000644 00000003416 15012237604 0015235 0 ustar 00 <?php namespace Modules\ContactUs\app\Http\Controllers; use App\Enums\RedirectType; use Illuminate\Http\Request; use Illuminate\Http\Response; use App\Traits\RedirectHelperTrait; use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Modules\Language\app\Models\Language; use Modules\ContactUs\app\Models\ContactUsPage; use Modules\Language\app\Traits\GenerateTranslationTrait; use Modules\ContactUs\app\Http\Requests\ContactUsPageRequest; class ContactUsController extends Controller { use RedirectHelperTrait, GenerateTranslationTrait; public function index() { checkAdminHasPermissionAndThrowException('contact.us.view'); $contactUsPage = ContactUsPage::first(); $code = request('code') ?? getSessionLanguage(); if (!Language::where('code', $code)->exists()) { abort(404); } $languages = allLanguages(); return view('contactus::contactuspage.index', compact('contactUsPage','code','languages')); } /** * Update the specified resource in storage. */ public function update(ContactUsPageRequest $request): RedirectResponse { checkAdminHasPermissionAndThrowException('contact.us.update'); $validatedData = $request->validated(); $ContactUsPage = ContactUsPage::first(); $ContactUsPage->update($validatedData); $this->updateTranslations( $ContactUsPage, $request, $validatedData, ); return $this->redirectWithMessage( RedirectType::UPDATE->value, 'admin.contact-us-page.index', [ 'contact_us_page' => $ContactUsPage->id, 'code' => $request->code, ] ); } } app/Http/Controllers/ContactInformationController.php 0000644 00000003641 15012237604 0017133 0 ustar 00 <?php namespace Modules\ContactUs\app\Http\Controllers; use App\Enums\RedirectType; use Illuminate\Http\Request; use Illuminate\Http\Response; use App\Traits\RedirectHelperTrait; use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Modules\Language\app\Models\Language; use Modules\ContactUs\app\Models\ContactInformation; use Modules\Language\app\Traits\GenerateTranslationTrait; use Modules\ContactUs\app\Http\Requests\ContactInformationRequest; use Cache; class ContactInformationController extends Controller { use RedirectHelperTrait, GenerateTranslationTrait; public function index() { checkAdminHasPermissionAndThrowException('contact.information.view'); $contactInformation= ContactInformation::first(); $code = request('code') ?? getSessionLanguage(); if (!Language::where('code', $code)->exists()) { abort(404); } $languages = allLanguages(); return view('contactus::contactinformation.index', compact('contactInformation','code','languages')); } /** * Update the specified resource in storage. */ public function update(ContactInformationRequest $request): RedirectResponse { checkAdminHasPermissionAndThrowException('contact.information.update'); $validatedData = $request->validated(); $contactInformation = ContactInformation::first(); $contactInformation->update($validatedData); $this->updateTranslations( $contactInformation, $request, $validatedData, ); Cache::forget('contactInformation'); return $this->redirectWithMessage( RedirectType::UPDATE->value, 'admin.contact-information.index', [ 'contact_us_page' => $contactInformation->id, 'code' => $request->code, ] ); } } app/Http/Requests/.gitkeep 0000644 00000000000 15012237604 0011475 0 ustar 00 app/Http/Requests/ContactUsPageRequest.php 0000644 00000001766 15012237604 0014652 0 ustar 00 <?php namespace Modules\ContactUs\app\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class ContactUsPageRequest extends FormRequest { /** * Get the validation rules that apply to the request. */ public function rules(): array { $languages = allLanguages(); $rules = [ 'phones' => $this->code == $languages->first()->code ? 'required':'', 'emails' => $this->code == $languages->first()->code ? 'required':'', 'map_embed_code' => $this->code == $languages->first()->code ? 'required':'', 'address' => 'required', ]; return $rules; } public function messages(): array { return [ 'phones.required' => trans('Phone number is required'), 'emails.string' => trans('Email is required'), 'map_embed_code.required' => trans('Google map is required'), 'address.required' => trans('Address is required'), ]; } } app/Http/Requests/ContactInformationRequest.php 0000644 00000002256 15012237604 0015746 0 ustar 00 <?php namespace Modules\ContactUs\app\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class ContactInformationRequest extends FormRequest { /** * Get the validation rules that apply to the request. */ public function rules(): array { $languages = allLanguages(); $rules = [ 'topbar_phone' => $this->code == $languages->first()->code ? 'required':'', 'topbar_email' => $this->code == $languages->first()->code ? 'required':'', 'footer_phone' => $this->code == $languages->first()->code ? 'required':'', 'footer_email' => $this->code == $languages->first()->code ? 'required':'', 'footer_address' => 'required', ]; return $rules; } public function messages(): array { return [ 'topbar_phone.required' => trans('Phone number is required'), 'topbar_email.string' => trans('Email is required'), 'footer_phone.required' => trans('Phone number is required'), 'footer_email.string' => trans('Email is required'), 'footer_address.required' => trans('Address is required'), ]; } } app/Http/Middleware/.gitkeep 0000644 00000000000 15012237604 0011737 0 ustar 00 app/Models/ContactUsPage.php 0000644 00000002171 15012237604 0011761 0 ustar 00 <?php namespace Modules\ContactUs\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\ContactUs\Database\factories\ContactUsPageFactory; class ContactUsPage extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['phones','emails','map_embed_code']; protected static function newFactory(): ContactUsPageFactory { //return ContactUsPageFactory::new(); } public function getTranslation($code): ?ContactUsPageTranslation { return $this->hasOne(ContactUsPageTranslation::class, 'contact_us_id')->where('lang_code', $code)->first(); } public function translations(): ?HasMany { return $this->hasMany(ContactUsPageTranslation::class, 'contact_us_id'); } public function translation(): ?HasOne { return $this->hasOne(ContactUsPageTranslation::class, 'contact_us_id')->where('lang_code', getSessionLanguage()); } } app/Models/ContactInformation.php 0000644 00000002406 15012237604 0013063 0 ustar 00 <?php namespace Modules\ContactUs\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\ContactUs\Database\factories\ContactInformationFactory; class ContactInformation extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['topbar_phone','topbar_email','footer_phone','footer_email','facebook','twitter','instagram','linkedin','youtube']; protected static function newFactory(): ContactInformationFactory { //return ContactInformationFactory::new(); } public function getTranslation($code): ?ContactInformationTranslation { return $this->hasOne(ContactInformationTranslation::class, 'contact_information_id')->where('lang_code', $code)->first(); } public function translations(): ?HasMany { return $this->hasMany(ContactInformationTranslation::class, 'contact_information_id'); } public function translation(): ?HasOne { return $this->hasOne(ContactInformationTranslation::class, 'contact_information_id')->where('lang_code', getSessionLanguage()); } } app/Models/.gitkeep 0000644 00000000000 15012237604 0010166 0 ustar 00 app/Models/error_log 0000644 00000001234 15012237604 0010464 0 ustar 00 [08-May-2025 08:32:24 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Models/ContactUsPage.php:11 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Models/ContactUsPage.php on line 11 [08-May-2025 08:44:07 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Models/ContactUsPageTranslation.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Models/ContactUsPageTranslation.php on line 9 app/Models/ContactInformationTranslation.php 0000644 00000001070 15012237604 0015276 0 ustar 00 <?php namespace Modules\ContactUs\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\ContactUs\Database\factories\ContactInformationTranslationFactory; class ContactInformationTranslation extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['footer_address']; protected static function newFactory(): ContactInformationTranslationFactory { //return ContactInformationTranslationFactory::new(); } } app/Models/ContactUsPageTranslation.php 0000644 00000001035 15012237604 0014176 0 ustar 00 <?php namespace Modules\ContactUs\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\ContactUs\Database\factories\ContactUsPageTranslationFactory; class ContactUsPageTranslation extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['address']; protected static function newFactory(): ContactUsPageTranslationFactory { //return ContactUsPageTranslationFactory::new(); } } app/Providers/ContactUsServiceProvider.php 0000644 00000006452 15012237604 0014760 0 ustar 00 <?php namespace Modules\ContactUs\app\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; class ContactUsServiceProvider extends ServiceProvider { protected string $moduleName = 'ContactUs'; protected string $moduleNameLower = 'contactus'; /** * 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/Providers/RouteServiceProvider.php 0000644 00000002673 15012237604 0014154 0 ustar 00 <?php namespace Modules\ContactUs\app\Providers; use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; class RouteServiceProvider extends ServiceProvider { /** * The module namespace to assume when generating URLs to actions. */ protected string $moduleNamespace = 'Modules\ContactUs\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('ContactUs', '/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('ContactUs', '/routes/api.php')); } } app/Providers/.gitkeep 0000644 00000000000 15012237604 0010720 0 ustar 00 app/Providers/error_log 0000644 00000001316 15012237604 0011217 0 ustar 00 [08-May-2025 19:45:36 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Foundation\Support\Providers\RouteServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Providers/RouteServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Providers/RouteServiceProvider.php on line 8 [09-May-2025 06:14:16 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\ServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Providers/ContactUsServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/app/Providers/ContactUsServiceProvider.php on line 8 database/factories/.gitkeep 0000644 00000000000 15012237604 0011706 0 ustar 00 database/migrations/2024_07_29_075730_create_contact_information_table.php 0000644 00000001403 15012237604 0022041 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('contact_information', function (Blueprint $table) { $table->id(); $table->text('topbar_phone')->nullable(); $table->text('topbar_email')->nullable(); $table->text('footer_phone')->nullable(); $table->text('footer_email')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('contact_information'); } }; database/migrations/.gitkeep 0000644 00000000000 15012237604 0012103 0 ustar 00 database/migrations/2024_07_29_065631_create_contact_us_pages_table.php 0000644 00000001231 15012237604 0021320 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('contact_us_pages', function (Blueprint $table) { $table->id(); $table->text('phones'); $table->text('emails'); $table->text('map_embed_code'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('contact_us_pages'); } }; database/migrations/2024_07_29_075751_create_contact_information_translations_table.php 0000644 00000001335 15012237604 0024651 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('contact_information_translations', function (Blueprint $table) { $table->id(); $table->integer('contact_information_id'); $table->string('lang_code'); $table->text('footer_address')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('contact_information_translations'); } }; database/migrations/error_log 0000644 00000003266 15012237604 0012410 0 ustar 00 [08-May-2025 03:45:05 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_065631_create_contact_us_pages_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_065631_create_contact_us_pages_table.php on line 7 [08-May-2025 03:50:41 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_075730_create_contact_information_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_075730_create_contact_information_table.php on line 7 [08-May-2025 03:55:55 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_075751_create_contact_information_translations_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_075751_create_contact_information_translations_table.php on line 7 [08-May-2025 03:58:52 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_065659_create_contact_us_page_translations_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/migrations/2024_07_29_065659_create_contact_us_page_translations_table.php on line 7 database/migrations/2024_07_29_065659_create_contact_us_page_translations_table.php 0000644 00000001273 15012237604 0023756 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('contact_us_page_translations', function (Blueprint $table) { $table->id(); $table->integer('contact_us_id'); $table->string('lang_code'); $table->string('address'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('contact_us_page_translations'); } }; database/seeders/.gitkeep 0000644 00000000000 15012237604 0011361 0 ustar 00 database/seeders/ContactInformationSeeder.php 0000644 00000002165 15012237604 0015410 0 ustar 00 <?php namespace Modules\ContactUs\database\seeders; use Illuminate\Database\Seeder; use Modules\Language\app\Models\Language; use Modules\ContactUs\app\Models\ContactInformation; use Modules\ContactUs\app\Models\ContactInformationTranslation; class ContactInformationSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $contactInformation = new ContactInformation(); $contactInformation->topbar_phone = '111-233-1273'; $contactInformation->topbar_email = 'info23@website.com'; $contactInformation->footer_phone = '111-233-1273'; $contactInformation->footer_email = 'example@gmail.com'; $contactInformation->save(); $languages = Language::get(); foreach($languages as $language){ $translation = new ContactInformationTranslation(); $translation->contact_information_id = $contactInformation->id; $translation->lang_code = $language->code; $translation->footer_address = 'San Francisco City Hall, San Francisco, CA'; $translation->save(); } } } database/seeders/ContactUsDatabaseSeeder.php 0000644 00000002612 15012237604 0015134 0 ustar 00 <?php namespace Modules\ContactUs\database\seeders; use Illuminate\Database\Seeder; use Modules\Language\app\Models\Language; use Modules\ContactUs\app\Models\ContactUsPage; use Modules\ContactUs\app\Models\ContactUsPageTranslation; class ContactUsDatabaseSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $contactUsPage = new ContactUsPage(); $contactUsPage->phones = '(347) 430-9510'; $contactUsPage->emails = 'support@websolutionus.com'; $contactUsPage->map_embed_code = '<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3153.459102763315!2d-122.42181662524695!3d37.779279211902285!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x808580997aeae663%3A0xb2706dff83574f4a!2sSan%20Francisco%20City%20Hall!5e0!3m2!1sen!2sbd!4v1723962124400!5m2!1sen!2sbd" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>'; $contactUsPage->save(); $languages = Language::get(); foreach($languages as $language){ $translation = new ContactUsPageTranslation(); $translation->contact_us_id = $contactUsPage->id; $translation->lang_code = $language->code; $translation->address = '95 South Park Avenue, New York, USA'; $translation->save(); } } } database/seeders/error_log 0000644 00000001272 15012237604 0011661 0 ustar 00 [08-May-2025 06:48:05 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/seeders/ContactInformationSeeder.php:10 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/seeders/ContactInformationSeeder.php on line 10 [08-May-2025 08:28:54 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/seeders/ContactUsDatabaseSeeder.php:10 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/ContactUs/database/seeders/ContactUsDatabaseSeeder.php on line 10 resources/assets/.gitkeep 0000644 00000000000 15012237604 0011477 0 ustar 00 resources/assets/js/app.js 0000644 00000000000 15012237604 0011600 0 ustar 00 resources/assets/sass/app.scss 0000644 00000000000 15012237604 0012474 0 ustar 00 resources/views/contactinformation/sidebar.blade.php 0000644 00000000372 15012237604 0017006 0 ustar 00 <li class="{{ isRoute('admin.contact-information.*', 'active') }}"> <a class="nav-link" href="{{ route('admin.contact-information.index', ['code' => getSessionLanguage()]) }}"> <span>{{ __('Contact Information') }}</span> </a> </li> resources/views/contactinformation/index.blade.php 0000644 00000024704 15012237604 0016511 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Contact Information') }}</title> @endsection @section('admin-content') <!-- Main Content --> <div class="main-content"> <section class="section"> <div class="section-header"> <h1>{{ __('Contact Information') }}</h1> </div> <div class="section-body row"> <div class="col-12"> <div class="card"> <div class="card-header gap-3 justify-content-between align-items-center"> <h5 class="m-0 service_card">{{ __('Available Translations') }}</h5> @adminCan('contact.information.translate') @if ($code !== $languages->first()->code) <x-admin.button onclick="translateAll()" id="translate-btn" :text="__('Translate')" /> @endif @endadminCan </div> <div class="card-body"> <div class="lang_list_top"> <ul class="lang_list"> @foreach ($languages = allLanguages() as $language) <li><a id="{{ request('code') == $language->code ? 'selected-language' : '' }}" href="{{ route('admin.contact-information.index', ['code' => $language->code]) }}"><i class="fas {{ request('code') == $language->code ? 'fa-eye' : 'fa-edit' }}"></i> {{ $language->name }}</a></li> @endforeach </ul> </div> <div class="mt-2 alert alert-danger" role="alert"> @php $current_language = $languages->where('code', request()->get('code'))->first(); @endphp <p>{{ __('Your editing mode') }}:<b> {{ $current_language?->name }}</b></p> </div> </div> </div> </div> </div> <div class="section-body"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <form action="{{ route('admin.contact-information.update', $contactInformation->id) }}" method="POST" enctype="multipart/form-data"> @csrf @method('PUT') <div class="row"> <div class="col-md-12"> <input type="hidden" name="code" value="{{ $code }}"> @if ($code == $languages->first()->code) <h6 class="home_border">{{ __('Topbar') }}</h6> <hr> <div class="form-group"> <x-admin.form-textarea name="topbar_phone" data-translate="true" label="{{ __('Phone') }}" value="{{ $contactInformation->topbar_phone }}" required="true" /> </div> <div class="form-group"> <x-admin.form-textarea name="topbar_email" data-translate="true" label="{{ __('Email') }}" value="{{ $contactInformation->topbar_email }}" required="true" /> </div> @endif <h6 class="home_border">{{ __('Footer') }}</h6> <hr> @if ($code == $languages->first()->code) <div class="form-group"> <x-admin.form-textarea name="footer_phone" data-translate="true" label="{{ __('Phone') }}" value="{{ $contactInformation->footer_phone }}" required="true" /> </div> <div class="form-group"> <x-admin.form-textarea name="footer_email" data-translate="true" label="{{ __('Email') }}" value="{{ $contactInformation->footer_email }}" required="true" /> </div> @endif <div class="form-group"> <x-admin.form-textarea name="footer_address" data-translate="true" label="{{ __('Address') }}" value="{{ $contactInformation->getTranslation($code)->footer_address }}" required="true" /> </div> </div> </div> @adminCan('contact.information.update') <x-admin.save-button :text="__('Update')"> </x-admin.save-button> @endadminCan </form> </div> </div> </div> </div> </div> </section> </div> @endsection @if ($code != $languages->first()->code) @push('js') <script> "use strict"; var isTranslatingInputs = true; function translateOneByOne(inputs, index = 0) { if (index >= inputs.length) { if (isTranslatingInputs) { isTranslatingInputs = false; translateAllTextarea(); } $('#translate-btn').prop('disabled', false); $('#update-btn').prop('disabled', false); return; } var $input = $(inputs[index]); var inputValue = $input.val(); if (inputValue) { $.ajax({ url: "{{ route('admin.languages.update.single') }}", type: "POST", data: { lang: '{{ $code }}', text: inputValue, _token: '{{ csrf_token() }}' }, dataType: 'json', beforeSend: function() { $input.prop('disabled', true); iziToast.show({ timeout: false, close: true, theme: 'dark', icon: 'loader', iconUrl: 'https://hub.izmirnic.com/Files/Images/loading.gif', title: "{{ __('Translation Processing, please wait...') }}", position: 'center', }); }, success: function(response) { $input.val(response); $input.prop('disabled', false); iziToast.destroy(); toastr.success("{{ __('Translated Successfully!') }}"); translateOneByOne(inputs, index + 1); }, error: function(jqXHR, textStatus, errorThrown) { console.error(textStatus, errorThrown); iziToast.destroy(); toastr.error('Error', 'Error'); } }); } else { translateOneByOne(inputs, index + 1); } } function translateAll() { iziToast.question({ timeout: 20000, close: false, overlay: true, displayMode: 'once', id: 'question', zindex: 999, title: "{{ __('This will take a while!') }}", message: "{{ __('Are you sure?') }}", position: 'center', buttons: [ ["<button><b>{{ __('YES') }}</b></button>", function(instance, toast) { var isDemo = "{{ env('APP_MODE') ?? 'LIVE' }}"; if (isDemo == 'DEMO') { instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); toastr.error( "{{ __('This Is Demo Version. You Can Not Change Anything') }}"); return; } $('#translate-btn').prop('disabled', true); $('#update-btn').prop('disabled', true); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); var inputs = $('input[data-translate="true"]').toArray(); translateOneByOne(inputs); }, true], ["<button>{{ __('NO') }}</button>", function(instance, toast) { instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }], ], onClosing: function(instance, toast, closedBy) {}, onClosed: function(instance, toast, closedBy) {} }); }; function translateAllTextarea() { var inputs = $('textarea[data-translate="true"]').toArray(); if (inputs.length === 0) { return; } translateOneByOne(inputs); } $(document).ready(function() { var selectedTranslation = $('#selected-language').text(); var btnText = "{{ __('Translate to') }}" + selectedTranslation; $('#translate-btn').text(btnText); }); </script> @endpush @endif resources/views/layouts/master.blade.php 0000644 00000001750 15012237604 0014470 0 ustar 00 <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="{{ csrf_token() }}"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>ContactUs Module - {{ config('app.name', 'Laravel') }}</title> <meta name="description" content="{{ $description ?? '' }}"> <meta name="keywords" content="{{ $keywords ?? '' }}"> <meta name="author" content="{{ $author ?? '' }}"> <!-- Fonts --> <link rel="preconnect" href="https://fonts.bunny.net"> <link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" /> {{-- Vite CSS --}} {{-- {{ module_vite('build-contactus', 'resources/assets/sass/app.scss') }} --}} </head> <body> @yield('content') {{-- Vite JS --}} {{-- {{ module_vite('build-contactus', 'resources/assets/js/app.js') }} --}} </body> resources/views/.gitkeep 0000644 00000000000 15012237604 0011332 0 ustar 00 resources/views/contactuspage/sidebar.blade.php 0000644 00000000351 15012237604 0015742 0 ustar 00 <li class="{{ isRoute('admin.contact-us-page.*', 'active') }}"> <a class="nav-link" href="{{ route('admin.contact-us-page.index', ['code' => getSessionLanguage()]) }}"> <span>{{ __('Contact Us') }}</span> </a> </li> resources/views/contactuspage/index.blade.php 0000644 00000023762 15012237604 0015453 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Contact Us Page') }}</title> @endsection @section('admin-content') <!-- Main Content --> <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Contact Us Page') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Contact Us Page') => '#', ]" /> <div class="section-body row"> <div class="col-12"> <div class="card"> <div class="card-header gap-3 justify-content-between align-items-center"> <h5 class="m-0 service_card">{{ __('Available Translations') }}</h5> @adminCan('contact.us.translate') <hr> @if ($code !== $languages->first()->code) <x-admin.button onclick="translateAll()" id="translate-btn" :text="__('Translate')" /> @endif @endadminCan </div> <div class="card-body"> <div class="lang_list_top"> <ul class="lang_list"> @foreach ($languages = allLanguages() as $language) <li><a id="{{ request('code') == $language->code ? 'selected-language' : '' }}" href="{{ route('admin.contact-us-page.index', ['code' => $language->code]) }}"><i class="fas {{ request('code') == $language->code ? 'fa-eye' : 'fa-edit' }}"></i> {{ $language->name }}</a></li> @endforeach </ul> </div> <div class="mt-2 alert alert-danger" role="alert"> @php $current_language = $languages->where('code', request()->get('code'))->first(); @endphp <p>{{ __('Your editing mode') }}:<b> {{ $current_language?->name }}</b></p> </div> </div> </div> </div> </div> <div class="section-body"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <form action="{{ route('admin.contact-us-page.update', $contactUsPage->id) }}" method="POST" enctype="multipart/form-data"> @csrf @method('PUT') <div class="row"> <div class="col-md-12"> <input type="hidden" name="code" value="{{ $code }}"> @if ($code == $languages->first()->code) <div class="form-group"> <x-admin.form-textarea name="phones" label="{{ __('Phone') }}" value="{!! old('phones', $contactUsPage->phones) !!}" required="true"/> </div> <div class="form-group"> <x-admin.form-textarea name="emails" label="{{ __('Email') }}" value="{!! old('emails', $contactUsPage->emails) !!}" required="true"/> </div> <div class="form-group"> <x-admin.form-textarea name="map_embed_code" label="{{ __('Google Map Embed Code') }}" value="{!! old('map_embed_code', $contactUsPage->map_embed_code) !!}" required="true"/> </div> @endif <div class="form-group"> <x-admin.form-textarea name="address" data-translate="true" label="{{ __('Address') }}" value="{!! $contactUsPage->getTranslation($code)->address !!}" required="true"/> </div> </div> </div> @adminCan('contact.us.update') <x-admin.update-button :text="__('Update')"></x-admin.update-button> @endadminCan </form> </div> </div> </div> </div> </div> </section> </div> @endsection @if ($code != $languages->first()->code) @push('js') <script> "use strict"; var isTranslatingInputs = true; function translateOneByOne(inputs, index = 0) { if (index >= inputs.length) { if (isTranslatingInputs) { isTranslatingInputs = false; translateAllTextarea(); } $('#translate-btn').prop('disabled', false); $('#update-btn').prop('disabled', false); return; } var $input = $(inputs[index]); var inputValue = $input.val(); if (inputValue) { $.ajax({ url: "{{ route('admin.languages.update.single') }}", type: "POST", data: { lang: '{{ $code }}', text: inputValue, _token: '{{ csrf_token() }}' }, dataType: 'json', beforeSend: function() { $input.prop('disabled', true); iziToast.show({ timeout: false, close: true, theme: 'dark', icon: 'loader', iconUrl: 'https://hub.izmirnic.com/Files/Images/loading.gif', title: "{{ __('Translation Processing, please wait...') }}", position: 'center', }); }, success: function(response) { $input.val(response); if ($input.hasClass('summernote')) { console.log($input); var inputId = $input.attr('id'); tinymce.get(inputId).setContent(response); } $input.prop('disabled', false); iziToast.destroy(); toastr.success("{{ __('Translated Successfully!') }}"); translateOneByOne(inputs, index + 1); }, error: function(jqXHR, textStatus, errorThrown) { console.error(textStatus, errorThrown); iziToast.destroy(); toastr.error('Error', 'Error'); } }); } else { translateOneByOne(inputs, index + 1); } } function translateAll() { iziToast.question({ timeout: 20000, close: false, overlay: true, displayMode: 'once', id: 'question', zindex: 999, title: "{{ __('This will take a while!') }}", message: "{{ __('Are you sure?') }}", position: 'center', buttons: [ ["<button><b>{{ __('YES') }}</b></button>", function(instance, toast) { var isDemo = "{{ env('APP_MODE') ?? 'LIVE' }}"; if (isDemo == 'DEMO') { instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); toastr.error( "{{ __('This Is Demo Version. You Can Not Change Anything') }}"); return; } $('#translate-btn').prop('disabled', true); $('#update-btn').prop('disabled', true); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); var inputs = $('input[data-translate="true"]').toArray(); translateOneByOne(inputs); }, true], ["<button>{{ __('NO') }}</button>", function(instance, toast) { instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }], ], onClosing: function(instance, toast, closedBy) {}, onClosed: function(instance, toast, closedBy) {} }); }; function translateAllTextarea() { var inputs = $('textarea[data-translate="true"]').toArray(); if (inputs.length === 0) { return; } translateOneByOne(inputs); } $(document).ready(function() { var selectedTranslation = $('#selected-language').text(); var btnText = "{{ __('Translate to') }}" + selectedTranslation; $('#translate-btn').text(btnText); }); </script> @endpush @endif
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка