uawdijnntqw1x1x1
IP : 18.223.195.30
Hostname : host45.registrar-servers.com
Kernel : Linux host45.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
jackpotjunglegam
/
public_html
/
core
/
app
/
Http
/
Controllers
/
Admin
/
SupportTicketController.php
/
/
<?php namespace App\Http\Controllers\Admin; use App\Constants\Status; use App\Http\Controllers\Controller; use App\Models\SupportMessage; use App\Models\SupportTicket; use App\Traits\SupportTicketManager; class SupportTicketController extends Controller { use SupportTicketManager; public function __construct() { parent::__construct(); $this->middleware(function ($request, $next) { $this->user = auth()->guard('admin')->user(); return $next($request); }); $this->userType = 'admin'; $this->column = 'admin_id'; } public function tickets() { $pageTitle = 'Support Tickets'; $items = SupportTicket::orderBy('id', 'desc')->with('user')->paginate(getPaginate()); return view('admin.support.tickets', compact('items', 'pageTitle')); } public function pendingTicket() { $pageTitle = 'Pending Tickets'; $items = SupportTicket::whereIn('status', [Status::TICKET_OPEN, Status::TICKET_REPLY])->orderBy('id', 'desc')->with('user')->paginate(getPaginate()); return view('admin.support.tickets', compact('items', 'pageTitle')); } public function closedTicket() { $pageTitle = 'Closed Tickets'; $items = SupportTicket::where('status', Status::TICKET_CLOSE)->orderBy('id', 'desc')->with('user')->paginate(getPaginate()); return view('admin.support.tickets', compact('items', 'pageTitle')); } public function answeredTicket() { $pageTitle = 'Answered Tickets'; $items = SupportTicket::orderBy('id', 'desc')->with('user')->where('status', Status::TICKET_ANSWER)->paginate(getPaginate()); return view('admin.support.tickets', compact('items', 'pageTitle')); } public function ticketReply($id) { $ticket = SupportTicket::with('user')->where('id', $id)->firstOrFail(); $pageTitle = 'Reply Ticket'; $messages = SupportMessage::with('ticket', 'admin', 'attachments')->where('support_ticket_id', $ticket->id)->orderBy('id', 'desc')->get(); return view('admin.support.reply', compact('ticket', 'messages', 'pageTitle')); } public function ticketDelete($id) { $message = SupportMessage::findOrFail($id); $path = getFilePath('ticket'); if ($message->attachments()->count() > 0) { foreach ($message->attachments as $attachment) { fileManager()->removeFile($path . '/' . $attachment->attachment); $attachment->delete(); } } $message->delete(); $notify[] = ['success', "Support ticket deleted successfully"]; return back()->withNotify($notify); } }
/home/jackpotjunglegam/public_html/core/app/Http/Controllers/Admin/SupportTicketController.php