uawdijnntqw1x1x1
IP : 216.73.217.77
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
/
dabbawali.sizzlingcafe.co.in
/
app
/
Services
/
ItemAddonService.php
/
/
<?php namespace App\Services; use Exception; use App\Models\Item; use Illuminate\Support\Facades\Log; use App\Http\Requests\PaginateRequest; use App\Http\Requests\ItemAddonRequest; use App\Models\ItemAddon; class ItemAddonService { public $itemExtra; protected $itemExtraFilter = [ 'item_id', 'name', 'price', 'status' ]; /** * @throws Exception */ public function list(PaginateRequest $request, Item $item) { try { $requests = $request->all(); $method = $request->get('paginate', 0) == 1 ? 'paginate' : 'get'; $methodValue = $request->get('paginate', 0) == 1 ? $request->get('per_page', 10) : '*'; $orderColumn = $request->get('order_column') ?? 'id'; $orderType = $request->get('order_type') ?? 'desc'; return ItemAddon::with('item', 'addonItem')->where(['item_id' => $item->id])->where(function ($query) use ($requests) { foreach ($requests as $key => $request) { if (in_array($key, $this->itemExtraFilter)) { $query->where($key, 'like', '%' . $request . '%'); } } })->orderBy($orderColumn, $orderType)->$method( $methodValue ); } catch (Exception $exception) { Log::info($exception->getMessage()); throw new Exception($exception->getMessage(), 422); } } /** * @throws Exception */ public function store(ItemAddonRequest $request, Item $item) { try { return ItemAddon::create($request->validated() + ['item_id' => $item->id]); } catch (Exception $exception) { Log::info($exception->getMessage()); throw new Exception($exception->getMessage(), 422); } } /** * @throws Exception */ public function destroy(Item $item, ItemAddon $itemExtra) { try { if ($item->id == $itemExtra->item_id) { $itemExtra->delete(); } else { throw new Exception(trans('all.item_match'), 422); } } catch (Exception $exception) { Log::info($exception->getMessage()); throw new Exception($exception->getMessage(), 422); } } }
/home/users/unlimited/www/dabbawali.sizzlingcafe.co.in/app/Services/ItemAddonService.php