Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/TermsAndCondition.tar
Назад
lang/.gitkeep 0000644 00000000000 15012233411 0007074 0 ustar 00 module.json 0000644 00000000406 15012233411 0006714 0 ustar 00 { "name": "TermsAndCondition", "alias": "termsandcondition", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\TermsAndCondition\\app\\Providers\\TermsAndConditionServiceProvider" ], "files": [] } tests/Unit/.gitkeep 0000644 00000000000 15012233411 0010234 0 ustar 00 tests/Feature/.gitkeep 0000644 00000000000 15012233411 0010710 0 ustar 00 vite.config.js 0000644 00000001330 15012233411 0007302 0 ustar 00 import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: '../../public/build-termsandcondition', emptyOutDir: true, manifest: true, }, plugins: [ laravel({ publicDirectory: '../../public', buildDirectory: 'build-termsandcondition', 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 15012233412 0007475 0 ustar 00 routes/error_log 0000644 00000001154 15012233412 0007774 0 ustar 00 [07-May-2025 22:03:14 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/routes/api.php:17 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/routes/api.php on line 17 [07-May-2025 22:51:06 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/routes/web.php:16 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/routes/web.php on line 16 routes/web.php 0000644 00000001601 15012233412 0007342 0 ustar 00 <?php use Illuminate\Support\Facades\Route; use Modules\TermsAndCondition\app\Http\Controllers\TermsAndConditionController; /* |-------------------------------------------------------------------------- | 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::get('terms-and-condition', [TermsAndConditionController::class, 'index'])->name('terms-and-condition'); Route::put('terms-and-condition-update', [TermsAndConditionController::class, 'update'])->name('terms-and-condition-update'); }); routes/api.php 0000644 00000001257 15012233412 0007345 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('termsandcondition', fn (Request $request) => $request->user())->name('termsandcondition'); }); composer.json 0000644 00000001371 15012233412 0007261 0 ustar 00 { "name": "nwidart/termsandcondition", "description": "", "authors": [ { "name": "Nicolas Widart", "email": "n.widart@gmail.com" } ], "extra": { "laravel": { "providers": [], "aliases": { } } }, "autoload": { "psr-4": { "Modules\\TermsAndCondition\\": "", "Modules\\TermsAndCondition\\App\\": "app/", "Modules\\TermsAndCondition\\Database\\Factories\\": "database/factories/", "Modules\\TermsAndCondition\\Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Modules\\TermsAndCondition\\Tests\\": "tests/" } } } config/config.php 0000644 00000000066 15012233412 0007762 0 ustar 00 <?php return [ 'name' => 'TermsAndCondition', ]; config/.gitkeep 0000644 00000000000 15012233412 0007421 0 ustar 00 package.json 0000644 00000000410 15012233412 0007016 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 15012233412 0012161 0 ustar 00 app/Http/Controllers/TermsAndConditionController.php 0000644 00000003345 15012233412 0016710 0 ustar 00 <?php namespace Modules\TermsAndCondition\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\Language\app\Traits\GenerateTranslationTrait; use Modules\TermsAndCondition\app\Models\TermsAndCondition; use Modules\TermsAndCondition\app\Http\Requests\TermsAndConditionRequest; class TermsAndConditionController extends Controller { use RedirectHelperTrait, GenerateTranslationTrait; public function index() { checkAdminHasPermissionAndThrowException('terms.and.condition.view'); $terms_and_condition = TermsAndCondition::first(); $code = request('code') ?? getSessionLanguage(); if (!Language::where('code', $code)->exists()) { abort(404); } $languages = allLanguages(); return view('termsandcondition::index', compact('terms_and_condition', 'code', 'languages')); } public function update(TermsAndConditionRequest $request): RedirectResponse { checkAdminHasPermissionAndThrowException('terms.and.condition.update'); $validatedData = $request->validated(); $terms_and_condition = TermsAndCondition::first(); $this->updateTranslations( $terms_and_condition, $request, $validatedData, ); return $this->redirectWithMessage( RedirectType::UPDATE->value, 'admin.terms-and-condition', [ 'terms_and_condition' => $terms_and_condition->id, 'code' => $request->code, ] ); } } app/Http/Requests/.gitkeep 0000644 00000000000 15012233412 0011466 0 ustar 00 app/Http/Requests/TermsAndConditionRequest.php 0000644 00000001120 15012233412 0015507 0 ustar 00 <?php namespace Modules\TermsAndCondition\app\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class TermsAndConditionRequest extends FormRequest { /** * Get the validation rules that apply to the request. */ public function rules(): array { $languages = allLanguages(); $rules = [ 'terms_and_condition' => 'required', ]; return $rules; } public function messages(): array { return [ 'terms_and_condition.required' => trans('Terms and condition is required'), ]; } } app/Http/Middleware/.gitkeep 0000644 00000000000 15012233412 0011730 0 ustar 00 app/Models/.gitkeep 0000644 00000000000 15012233412 0010157 0 ustar 00 app/Models/error_log 0000644 00000001314 15012233412 0010454 0 ustar 00 [11-May-2025 05:50:41 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/app/Models/TermsAndConditionTranslation.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/app/Models/TermsAndConditionTranslation.php on line 9 [11-May-2025 06:02:21 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/app/Models/TermsAndCondition.php:12 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/app/Models/TermsAndCondition.php on line 12 app/Models/TermsAndCondition.php 0000644 00000002312 15012233412 0012633 0 ustar 00 <?php namespace Modules\TermsAndCondition\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\TermsAndCondition\app\Models\TermsAndConditionTranslation; use Modules\TermsAndCondition\Database\factories\TermsAndConditionFactory; class TermsAndCondition extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): TermsAndConditionFactory { //return TermsAndConditionFactory::new(); } public function getTranslation($code): ?TermsAndConditionTranslation { return $this->hasOne(TermsAndConditionTranslation::class)->where('lang_code', $code)->first(); } public function translations(): ?HasMany { return $this->hasMany(TermsAndConditionTranslation::class, 'terms_and_condition_id'); } public function translation(): ?HasOne { return $this->hasOne(TermsAndConditionTranslation::class, 'terms_and_condition_id')->where('lang_code', getSessionLanguage()); } } app/Models/TermsAndConditionTranslation.php 0000644 00000001111 15012233412 0015046 0 ustar 00 <?php namespace Modules\TermsAndCondition\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\TermsAndCondition\Database\factories\TermsAndConditionTranslationFactory; class TermsAndConditionTranslation extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['terms_and_condition']; protected static function newFactory(): TermsAndConditionTranslationFactory { //return TermsAndConditionTranslationFactory::new(); } } app/Providers/RouteServiceProvider.php 0000644 00000002733 15012233412 0014142 0 ustar 00 <?php namespace Modules\TermsAndCondition\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\TermsAndCondition\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('TermsAndCondition', '/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('TermsAndCondition', '/routes/api.php')); } } app/Providers/.gitkeep 0000644 00000000000 15012233412 0010711 0 ustar 00 app/Providers/TermsAndConditionServiceProvider.php 0000644 00000006512 15012233412 0016427 0 ustar 00 <?php namespace Modules\TermsAndCondition\app\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; class TermsAndConditionServiceProvider extends ServiceProvider { protected string $moduleName = 'TermsAndCondition'; protected string $moduleNameLower = 'termsandcondition'; /** * 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/error_log 0000644 00000000576 15012233412 0011217 0 ustar 00 [11-May-2025 07:22:10 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\ServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/app/Providers/TermsAndConditionServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/app/Providers/TermsAndConditionServiceProvider.php on line 8 database/factories/.gitkeep 0000644 00000000000 15012233412 0011677 0 ustar 00 database/migrations/.gitkeep 0000644 00000000000 15012233412 0012074 0 ustar 00 database/migrations/2024_01_15_121535_create_terms_and_conditions_table.php 0000644 00000001072 15012233412 0022161 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('terms_and_conditions', function (Blueprint $table) { $table->id(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('terms_and_conditions'); } }; database/migrations/error_log 0000644 00000000716 15012233412 0012376 0 ustar 00 [09-May-2025 03:30:46 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/database/migrations/2024_01_15_121639_create_terms_and_condition_translations_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/database/migrations/2024_01_15_121639_create_terms_and_condition_translations_table.php on line 7 database/migrations/2024_01_15_121639_create_terms_and_condition_translations_table.php 0000644 00000001332 15012233412 0024603 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('terms_and_condition_translations', function (Blueprint $table) { $table->id(); $table->integer('terms_and_condition_id'); $table->string('lang_code'); $table->longText('terms_and_condition'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('terms_and_condition_translations'); } }; database/seeders/TermsAndConditionPermissionSeeder.php 0000644 00000002334 15012233412 0017233 0 ustar 00 <?php namespace Modules\TermsAndCondition\database\seeders; use Illuminate\Database\Seeder; use Spatie\Permission\Models\Role; use Spatie\Permission\Models\Permission; class TermsAndConditionPermissionSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $roleSuperAdmin = Role::where(['guard_name' => 'admin'])->first(); $permissions = [ [ 'group_name' => 'terms and condition', 'permissions' => [ 'terms.and.condition.view', 'terms.and.condition.update', 'terms.and.condition.translate', ] ], ]; for ($i = 0; $i < count($permissions); $i++) { $permissionGroup = $permissions[$i]['group_name']; for ($j = 0; $j < count($permissions[$i]['permissions']); $j++) { $permission = Permission::create([ 'name' => $permissions[$i]['permissions'][$j], 'group_name' => $permissionGroup, 'guard_name' => 'admin' ]); $roleSuperAdmin->givePermissionTo($permission); } } } } database/seeders/.gitkeep 0000644 00000000000 15012233412 0011352 0 ustar 00 database/seeders/error_log 0000644 00000001370 15012233412 0011651 0 ustar 00 [08-May-2025 06:15:18 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/database/seeders/TermsAndConditionDatabaseSeeder.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/database/seeders/TermsAndConditionDatabaseSeeder.php on line 9 [08-May-2025 06:46:44 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/database/seeders/TermsAndConditionPermissionSeeder.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/TermsAndCondition/database/seeders/TermsAndConditionPermissionSeeder.php on line 9 database/seeders/TermsAndConditionDatabaseSeeder.php 0000644 00000001540 15012233412 0016605 0 ustar 00 <?php namespace Modules\TermsAndCondition\database\seeders; use Illuminate\Database\Seeder; use Modules\TermsAndCondition\app\Models\TermsAndCondition; use Modules\TermsAndCondition\app\Models\TermsAndConditionTranslation; class TermsAndConditionDatabaseSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $terms_and_condition = new TermsAndCondition(); $terms_and_condition->save(); $languages = allLanguages(); foreach($languages as $language){ $translation = new TermsAndConditionTranslation(); $translation->terms_and_condition_id = $terms_and_condition->id; $translation->lang_code = $language->code; $translation->terms_and_condition = 'Terms And Condition Text'; $translation->save(); } } } resources/assets/.gitkeep 0000644 00000000000 15012233412 0011470 0 ustar 00 resources/assets/js/app.js 0000644 00000000000 15012233412 0011571 0 ustar 00 resources/assets/sass/app.scss 0000644 00000000000 15012233412 0012465 0 ustar 00 resources/views/sidebar.blade.php 0000644 00000000370 15012233412 0013074 0 ustar 00 <li class="{{ Route::is('admin.terms-and-condition') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.terms-and-condition', ['code' => getSessionLanguage()]) }}"> <span>{{ __('Terms And Condition') }}</span> </a> </li>