uawdijnntqw1x1x1
IP : 216.73.216.93
Hostname : panel.codeskitter.com
Kernel : Linux panel.codeskitter.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
Disable Function : apache_child_terminate, apache_note, apache_setenv, define_syslog_variables, dl, link, opcache_get_status, openlog, pcntl_exec, pcntl_fork, pcntl_setpriority, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid
OS : Linux
PATH:
/
home
/
users
/
unlimited
/
www
/
learnoid.codeskitter.site
/
app
/
Repositories
/
LanguageRepository.php
/
/
<?php namespace App\Repositories; use Abedin\Maker\Repositories\Repository; use App\Http\Requests\LanguageRequest; use App\Models\Language; class LanguageRepository extends Repository { public static function model() { return Language::class; } public static function storeByRequest(LanguageRequest $request) { $filePath = base_path("lang/$request->name.json"); $jsonData = file_get_contents(public_path('default/languages.json')); try { file_put_contents($filePath, $jsonData, JSON_PRETTY_PRINT); self::create([ 'title' => $request->title, 'name' => $request->name, ]); return ['type' => 'success', 'message' => __('Created Successfully')]; } catch (\Throwable $e) { return ['type' => 'error', 'message' => $e->getMessage()]; } } public static function updateByRequest(Language $language, LanguageRequest $request, $filePath) { $processedData = []; foreach ($request->data as $entry) { $key = $entry['key']; $value = array_key_exists('value', $entry) ? $entry['value'] : ''; $processedData[$key] = $value; } $existingData = json_decode(file_get_contents($filePath), true); $updatedData = array_merge($existingData, $processedData); try { file_put_contents($filePath, json_encode($updatedData, JSON_PRETTY_PRINT)); $language->update([ 'title' => $request->title, ]); return $language; return ['type' => 'success', 'message' => __('Updated Successfully')]; } catch (\Throwable $e) { return ['type' => 'error', 'message' => $e->getMessage()]; } } public static function checkFileExitsOrNot(array $fileNames) { foreach ($fileNames as $name) { if (! self::isNameExists($name)) { self::create([ 'title' => $name, 'name' => $name, ]); } } } public static function isNameExists($name) { return self::query()->where('name', $name)->exists(); } }
/home/users/unlimited/www/learnoid.codeskitter.site/app/Repositories/LanguageRepository.php