Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/SupportTicket.tar
Назад
lang/.gitkeep 0000644 00000000000 15012231362 0007077 0 ustar 00 module.json 0000644 00000000366 15012231362 0006724 0 ustar 00 { "name": "SupportTicket", "alias": "supportticket", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\SupportTicket\\app\\Providers\\SupportTicketServiceProvider" ], "files": [] } tests/Unit/.gitkeep 0000644 00000000000 15012231362 0010237 0 ustar 00 tests/Feature/.gitkeep 0000644 00000000000 15012231362 0010713 0 ustar 00 vite.config.js 0000644 00000001320 15012231362 0007304 0 ustar 00 import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: '../../public/build-supportticket', emptyOutDir: true, manifest: true, }, plugins: [ laravel({ publicDirectory: '../../public', buildDirectory: 'build-supportticket', input: [ __dirname + '/resources/assets/sass/app.scss', __dirname + '/resources/assets/js/app.js' ], refresh: true, }), ], }); //export const paths = [ // 'Modules/$STUDLY_NAME$/resources/assets/sass/app.scss', // 'Modules/$STUDLY_NAME$/resources/assets/js/app.js', //]; wsus.json 0000644 00000000637 15012231362 0006441 0 ustar 00 { "name": "Support Ticket Addon", "is_default": true, "description": "This is Support Ticket Addon", "author": { "name": "Websolutionsus", "email": "websolutionus1@gmail.com", "website": "https://websolutionus.com" }, "license": "Proprietary", "url": "", "options" : { "route" : "home" }, "last_update": "2024-03-31", "version": "1.0.0" } routes/.gitkeep 0000644 00000000000 15012231363 0007500 0 ustar 00 routes/error_log 0000644 00000001130 15012231363 0007771 0 ustar 00 [09-May-2025 00:53:02 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/routes/web.php:6 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/routes/web.php on line 6 [09-May-2025 05:47:37 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/routes/api.php:5 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/routes/api.php on line 5 routes/web.php 0000644 00000001247 15012231363 0007353 0 ustar 00 <?php use Illuminate\Support\Facades\Route; use Modules\SupportTicket\app\Http\Controllers\SupportTicketController; Route::middleware(['auth:admin', 'translation']) ->prefix('admin/support') ->name('admin.support.') ->controller(SupportTicketController::class) ->group(function () { Route::get('ticket', 'index')->name('ticket'); Route::get('ticket-show/{id}', 'show')->name('ticket-show'); Route::delete('ticket-delete/{id}', 'destroy')->name('ticket-delete'); Route::put('ticket-closed/{id}', 'closed')->name('ticket-closed'); Route::post('store-ticket-message', 'store_message')->name('store-ticket-message'); }); routes/api.php 0000644 00000000214 15012231363 0007340 0 ustar 00 <?php use Illuminate\Support\Facades\Route; Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () { }); composer.json 0000644 00000001341 15012231363 0007261 0 ustar 00 { "name": "nwidart/supportticket", "description": "", "authors": [ { "name": "Nicolas Widart", "email": "n.widart@gmail.com" } ], "extra": { "laravel": { "providers": [], "aliases": { } } }, "autoload": { "psr-4": { "Modules\\SupportTicket\\": "", "Modules\\SupportTicket\\App\\": "app/", "Modules\\SupportTicket\\Database\\Factories\\": "database/factories/", "Modules\\SupportTicket\\Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Modules\\SupportTicket\\Tests\\": "tests/" } } } config/config.php 0000644 00000000062 15012231363 0007761 0 ustar 00 <?php return [ 'name' => 'SupportTicket', ]; config/.gitkeep 0000644 00000000000 15012231363 0007424 0 ustar 00 package.json 0000644 00000000410 15012231363 0007021 0 ustar 00 { "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.5", "sass": "^1.69.5", "postcss": "^8.3.7", "vite": "^4.0.0" } } app/Http/Controllers/SupportTicketController.php 0000644 00000011165 15012231363 0016146 0 ustar 00 <?php namespace Modules\SupportTicket\app\Http\Controllers; use App\Enums\RedirectType; use App\Http\Controllers\Controller; use App\Traits\RedirectHelperTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\File; use Modules\SupportTicket\app\Models\MessageDocument; use Modules\SupportTicket\app\Models\Ticket; use Modules\SupportTicket\app\Models\TicketMessage; class SupportTicketController extends Controller { use RedirectHelperTrait; public function index() { checkAdminHasPermissionAndThrowException('support.ticket.view'); $tickets = Ticket::with('user')->orderBy('id', 'desc')->paginate(15); return view('supportticket::ticket', compact('tickets')); } public function show($id) { checkAdminHasPermissionAndThrowException('support.ticket.manage'); $ticket = Ticket::with('user')->where('id', $id)->first(); TicketMessage::where('ticket_id', $ticket->id)->update(['unseen_admin' => 1]); $messages = TicketMessage::where('ticket_id', $ticket->id)->get(); return view('supportticket::ticket_show', compact('ticket', 'messages')); } public function destroy($id) { checkAdminHasPermissionAndThrowException('support.ticket.delete'); Ticket::where('id', $id)->delete(); $messages = TicketMessage::where('ticket_id', $id)->get(); foreach ($messages as $message) { $documents = MessageDocument::where('ticket_message_id', $message->id)->get(); foreach ($documents as $document) { $exist_file_name = $document->file_name; if ($exist_file_name) { if (File::exists(public_path('uploads/custom-images').'/'.$exist_file_name)) { unlink(public_path('uploads/custom-images').'/'.$exist_file_name); } } $document->delete(); } $message->delete(); } return $this->redirectWithMessage(RedirectType::DELETE->value); } public function closed($id) { checkAdminHasPermissionAndThrowException('support.ticket.close'); $ticket = Ticket::where('id', $id)->first(); $ticket->status = 'closed'; $ticket->save(); $notification = __('Closed Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return $this->redirectWithMessage(RedirectType::UPDATE->value, null, [], $notification); } public function store_message(Request $request) { checkAdminHasPermissionAndThrowException('support.ticket.manage'); $rules = [ 'ticket_id' => 'required', 'message' => 'required', 'user_id' => 'required', 'documents' => 'max:2048', ]; $customMessages = [ 'message.required' => __('Message is required'), 'ticket_id.required' => __('Ticket is required'), 'user_id.required' => __('User is required'), ]; $this->validate($request, $rules, $customMessages); $admin = Auth::guard('admin')->user(); $message = new TicketMessage(); $message->ticket_id = $request->ticket_id; $message->admin_id = $admin->id; $message->user_id = $request->user_id; $message->message = $request->message; $message->message_from = 'admin'; $message->unseen_admin = 1; $message->save(); if ($request->hasFile('documents')) { foreach ($request->documents as $index => $request_file) { $extention = $request_file->getClientOriginalExtension(); $file_name = 'support-file-'.time().$index.'.'.$extention; $destinationPath = public_path('uploads/custom-images/'); $request_file->move($destinationPath, $file_name); $document = new MessageDocument(); $document->ticket_message_id = $message->id; $document->file_name = $file_name; $document->save(); } } $firstSmsExist = TicketMessage::where('admin_id', '!=', 0)->where('ticket_id', $request->ticket_id)->count(); if ($firstSmsExist == 1) { $ticket = Ticket::where(['id' => $request->ticket_id])->first(); $ticket->status = 'in_progress'; $ticket->save(); } $notification = __('Message Sent Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return $this->redirectWithMessage(RedirectType::UPDATE->value, null, [], $notification); } } app/Http/Controllers/.gitkeep 0000644 00000000000 15012231363 0012164 0 ustar 00 app/Http/Controllers/TicketController.php 0000644 00000010735 15012231363 0014553 0 ustar 00 <?php namespace Modules\SupportTicket\app\Http\Controllers; use App\Enums\RedirectType; use App\Http\Controllers\Controller; use App\Traits\RedirectHelperTrait; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Modules\SupportTicket\app\Models\MessageDocument; use Modules\SupportTicket\app\Models\Ticket; use Modules\SupportTicket\app\Models\TicketMessage; class TicketController extends Controller { use RedirectHelperTrait; public function index() { $user = Auth::guard('web')->user(); $tickets = Ticket::with('user', 'unSeenUserMessage')->where('user_id', $user->id)->orderBy('id', 'desc')->get(); return view('user.ticket', compact('tickets')); } public function show($id) { $ticket = Ticket::with('user')->where('ticket_id', $id)->first(); TicketMessage::where('ticket_id', $ticket->id)->update(['unseen_user' => 1]); $messages = TicketMessage::where('ticket_id', $ticket->id)->get(); return view('user.ticket_show', compact('ticket', 'messages')); } public function store_message(Request $request) { $rules = [ 'ticket_id' => 'required', 'message' => 'required', 'user_id' => 'required', 'documents' => 'max:2048', ]; $customMessages = [ 'message.required' => __('Message is required'), 'ticket_id.required' => __('Ticket is required'), 'user_id.required' => __('User is required'), ]; $this->validate($request, $rules, $customMessages); $user = Auth::guard('web')->user(); $message = new TicketMessage(); $message->ticket_id = $request->ticket_id; $message->admin_id = 0; $message->user_id = $user->id; $message->message = $request->message; $message->message_from = 'provider'; $message->unseen_user = 1; $message->unseen_admin = 0; $message->save(); if ($request->hasFile('documents')) { foreach ($request->documents as $index => $request_file) { $extention = $request_file->getClientOriginalExtension(); $file_name = 'support-file-'.time().$index.'.'.$extention; $destinationPath = public_path('uploads/custom-images/'); $request_file->move($destinationPath, $file_name); $document = new MessageDocument(); $document->ticket_message_id = $message->id; $document->file_name = $file_name; $document->save(); } } $firstSmsExist = TicketMessage::where('admin_id', 0)->count(); if ($firstSmsExist == 0) { $ticket = Ticket::where(['id' => $request->ticket_id])->first(); $ticket->status = 1; $ticket->save(); } $notification = __('Message Sent Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return $this->redirectWithMessage(RedirectType::CREATE->value, null, [], $notification); } public function create_new_ticket() { $user = Auth::guard('web')->user(); return view('user.ticket_create', compact('user')); } public function store_new_ticket(Request $request) { $rules = [ 'subject' => 'required', 'message' => 'required', ]; $customMessages = [ 'subject.required' => __('Subject is required'), 'message.required' => __('Message is required'), ]; $this->validate($request, $rules, $customMessages); $user = Auth::guard('web')->user(); $ticket = new Ticket(); $ticket->user_id = $user->id; $ticket->subject = $request->subject; $ticket->ticket_id = substr(rand(0, time()), 0, 10); $ticket->status = 'pending'; $ticket->ticket_from = 'provider'; $ticket->save(); $message = new TicketMessage(); $message->ticket_id = $ticket->id; $message->admin_id = 0; $message->user_id = $user->id; $message->message = $request->message; $message->message_from = 'provider'; $message->unseen_user = 1; $message->unseen_admin = 0; $message->save(); $notification = __('Created Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return $this->redirectWithMessage(RedirectType::CREATE->value, null, [], $notification); } } app/Http/Controllers/error_log 0000644 00000001324 15012231363 0012462 0 ustar 00 [11-May-2025 13:57:04 UTC] PHP Fatal error: Uncaught Error: Class "App\Http\Controllers\Controller" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Http/Controllers/TicketController.php:14 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Http/Controllers/TicketController.php on line 14 [11-May-2025 13:57:04 UTC] PHP Fatal error: Uncaught Error: Class "App\Http\Controllers\Controller" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Http/Controllers/SupportTicketController.php:15 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Http/Controllers/SupportTicketController.php on line 15 app/Http/Requests/.gitkeep 0000644 00000000000 15012231363 0011471 0 ustar 00 app/Http/Middleware/.gitkeep 0000644 00000000000 15012231363 0011733 0 ustar 00 app/Models/.gitkeep 0000644 00000000000 15012231363 0010162 0 ustar 00 app/Models/Ticket.php 0000644 00000002050 15012231363 0010474 0 ustar 00 <?php namespace Modules\SupportTicket\app\Models; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Ticket extends Model { use HasFactory; protected $fillable = []; protected $appends = ['unseen_for_user', 'unseen_for_admin']; public function getUnseenForUserAttribute() { return $this->unSeenUserMessage()->count(); } public function getUnseenForAdminAttribute() { return $this->unSeenAdminMessage()->count(); } public function user() { return $this->belongsTo(User::class, 'user_id')->select('id', 'name', 'email', 'image', 'phone', 'address'); } public function messages() { return $this->hasMany(TicketMessage::class); } public function unSeenUserMessage() { return $this->hasMany(TicketMessage::class)->where('unseen_user', 0); } public function unSeenAdminMessage() { return $this->hasMany(TicketMessage::class)->where('unseen_admin', 0); } } app/Models/MessageDocument.php 0000644 00000000764 15012231363 0012346 0 ustar 00 <?php namespace Modules\SupportTicket\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Modules\SupportTicket\Database\factories\MessageDocumentFactory; class MessageDocument extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): MessageDocumentFactory { //return MessageDocumentFactory::new(); } } app/Models/error_log 0000644 00000001724 15012231363 0010464 0 ustar 00 [13-May-2025 21:00:15 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Models/MessageDocument.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Models/MessageDocument.php on line 9 [13-May-2025 21:00:25 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Models/TicketMessage.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Models/TicketMessage.php on line 9 [13-May-2025 21:07:27 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Models/Ticket.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Models/Ticket.php on line 9 app/Models/TicketMessage.php 0000644 00000001043 15012231363 0012002 0 ustar 00 <?php namespace Modules\SupportTicket\app\Models; use App\Models\Admin; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class TicketMessage extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['unseen_admin']; public function admin() { return $this->belongsTo(Admin::class)->select('id', 'name'); } public function documents() { return $this->hasMany(MessageDocument::class); } } app/Providers/RouteServiceProvider.php 0000644 00000002713 15012231363 0014143 0 ustar 00 <?php namespace Modules\SupportTicket\app\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { /** * The module namespace to assume when generating URLs to actions. */ protected string $moduleNamespace = 'Modules\SupportTicket\app\Http\Controllers'; /** * Called before routes are registered. * * Register any model bindings or pattern based filters. */ public function boot(): void { parent::boot(); } /** * Define the routes for the application. */ public function map(): void { $this->mapApiRoutes(); $this->mapWebRoutes(); } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. */ protected function mapWebRoutes(): void { Route::middleware('web') ->namespace($this->moduleNamespace) ->group(module_path('SupportTicket', '/routes/web.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. */ protected function mapApiRoutes(): void { Route::prefix('api') ->middleware('api') ->namespace($this->moduleNamespace) ->group(module_path('SupportTicket', '/routes/api.php')); } } app/Providers/.gitkeep 0000644 00000000000 15012231363 0010714 0 ustar 00 app/Providers/error_log 0000644 00000001346 15012231363 0011216 0 ustar 00 [08-May-2025 02:41:13 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\ServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Providers/SupportTicketServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Providers/SupportTicketServiceProvider.php on line 8 [08-May-2025 02:45:48 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Foundation\Support\Providers\RouteServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Providers/RouteServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/app/Providers/RouteServiceProvider.php on line 8 app/Providers/SupportTicketServiceProvider.php 0000644 00000006472 15012231363 0015673 0 ustar 00 <?php namespace Modules\SupportTicket\app\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; class SupportTicketServiceProvider extends ServiceProvider { protected string $moduleName = 'SupportTicket'; protected string $moduleNameLower = 'supportticket'; /** * Boot the application events. */ public function boot(): void { $this->registerCommands(); $this->registerCommandSchedules(); $this->registerTranslations(); $this->registerConfig(); $this->registerViews(); $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); } /** * Register the service provider. */ public function register(): void { $this->app->register(RouteServiceProvider::class); } /** * Register commands in the format of Command::class */ protected function registerCommands(): void { // $this->commands([]); } /** * Register command Schedules. */ protected function registerCommandSchedules(): void { // $this->app->booted(function () { // $schedule = $this->app->make(Schedule::class); // $schedule->command('inspire')->hourly(); // }); } /** * Register translations. */ public function registerTranslations(): void { $langPath = resource_path('lang/modules/'.$this->moduleNameLower); if (is_dir($langPath)) { $this->loadTranslationsFrom($langPath, $this->moduleNameLower); $this->loadJsonTranslationsFrom($langPath); } else { $this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower); $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang')); } } /** * Register config. */ protected function registerConfig(): void { $this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config'); $this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower); } /** * Register views. */ public function registerViews(): void { $viewPath = resource_path('views/modules/'.$this->moduleNameLower); $sourcePath = module_path($this->moduleName, 'resources/views'); $this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']); $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); $componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.config('modules.paths.generator.component-class.path')); Blade::componentNamespace($componentNamespace, $this->moduleNameLower); } /** * Get the services provided by the provider. */ public function provides(): array { return []; } private function getPublishableViewPaths(): array { $paths = []; foreach (config('view.paths') as $path) { if (is_dir($path.'/modules/'.$this->moduleNameLower)) { $paths[] = $path.'/modules/'.$this->moduleNameLower; } } return $paths; } } database/factories/.gitkeep 0000644 00000000000 15012231363 0011702 0 ustar 00 database/migrations/.gitkeep 0000644 00000000000 15012231363 0012077 0 ustar 00 database/migrations/error_log 0000644 00000002340 15012231363 0012374 0 ustar 00 [11-May-2025 08:03:23 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/migrations/2023_11_21_073111_create_message_documents_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/migrations/2023_11_21_073111_create_message_documents_table.php on line 7 [11-May-2025 08:06:21 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/migrations/2023_11_21_072809_create_ticket_messages_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/migrations/2023_11_21_072809_create_ticket_messages_table.php on line 7 [11-May-2025 10:56:22 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/migrations/2023_11_21_072803_create_tickets_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/migrations/2023_11_21_072803_create_tickets_table.php on line 7 database/migrations/2023_11_21_073111_create_message_documents_table.php 0000644 00000001202 15012231363 0021450 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('message_documents', function (Blueprint $table) { $table->id(); $table->integer('ticket_message_id'); $table->string('file_name'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('message_documents'); } }; database/migrations/2023_11_21_072803_create_tickets_table.php 0000644 00000001356 15012231363 0017432 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('tickets', function (Blueprint $table) { $table->id(); $table->integer('user_id'); $table->text('subject'); $table->string('ticket_id'); $table->string('ticket_from'); $table->string('status')->default('pending'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('tickets'); } }; database/migrations/2023_11_21_072809_create_ticket_messages_table.php 0000644 00000001540 15012231363 0021137 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('ticket_messages', function (Blueprint $table) { $table->id(); $table->integer('ticket_id'); $table->integer('user_id'); $table->integer('admin_id'); $table->text('message'); $table->string('message_from'); $table->integer('unseen_admin')->default(0); $table->integer('unseen_user')->default(0); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('ticket_messages'); } }; database/seeders/.gitkeep 0000644 00000000000 15012231363 0011355 0 ustar 00 database/seeders/SupportTicketDatabaseSeeder.php 0000644 00000000407 15012231363 0016045 0 ustar 00 <?php namespace Modules\SupportTicket\database\seeders; use Illuminate\Database\Seeder; class SupportTicketDatabaseSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } database/seeders/MessageDocumentSeeder.php 0000644 00000000401 15012231363 0014655 0 ustar 00 <?php namespace Modules\SupportTicket\database\seeders; use Illuminate\Database\Seeder; class MessageDocumentSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } database/seeders/TicketMessageSeeder.php 0000644 00000000377 15012231363 0014336 0 ustar 00 <?php namespace Modules\SupportTicket\database\seeders; use Illuminate\Database\Seeder; class TicketMessageSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } database/seeders/error_log 0000644 00000002556 15012231363 0011663 0 ustar 00 [11-May-2025 07:52:00 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/SupportTicketDatabaseSeeder.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/SupportTicketDatabaseSeeder.php on line 7 [11-May-2025 07:58:37 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/TicketMessageSeeder.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/TicketMessageSeeder.php on line 7 [11-May-2025 07:58:42 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/MessageDocumentSeeder.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/MessageDocumentSeeder.php on line 7 [11-May-2025 07:59:53 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Seeder" not found in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/TicketSeeder.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/SupportTicket/database/seeders/TicketSeeder.php on line 7 database/seeders/TicketSeeder.php 0000644 00000000370 15012231363 0013022 0 ustar 00 <?php namespace Modules\SupportTicket\database\seeders; use Illuminate\Database\Seeder; class TicketSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } resources/assets/.gitkeep 0000644 00000000000 15012231363 0011473 0 ustar 00 resources/assets/js/app.js 0000644 00000000000 15012231363 0011574 0 ustar 00 resources/assets/sass/app.scss 0000644 00000000000 15012231363 0012470 0 ustar 00 resources/views/sidebar.blade.php 0000644 00000000671 15012231363 0013103 0 ustar 00 @if (Module::isEnabled('SupportTicket') && Route::has('admin.support.ticket')) <li class="{{ isRoute('admin.support.*') ? 'active' : '' }}"> <a class="nav-link" href="{{ route('admin.support.ticket') }}"> <i class="fas fa-ticket-alt"></i> <span>{{ __('Support Tickets') }} @if (false) <small class="badge bg-info">0</small> @endif </span> </a> </li> @endif resources/views/.gitkeep 0000644 00000000000 15012231363 0011326 0 ustar 00 resources/views/ticket.blade.php 0000644 00000012154 15012231363 0012754 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Support Tickets') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Support Ticket') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Support Ticket') => '#', ]" /> <div class="section-body"> <div class="mt-4 row"> <div class="col-12"> <div class="card"> <div class="card-header d-flex justify-content-between"> <x-admin.form-title :text="__('Support Tickets')" /> </div> <div class="card-body"> <div class="table-responsive max-h-400"> <table class="table table-striped report_table"> <thead> <tr> <th>{{ __('SN') }}</th> <th>{{ __('Ticket Info') }}</th> <th>{{ __('Unread Message') }}</th> <th>{{ __('Status') }}</th> <th>{{ __('Action') }}</th> </tr> </thead> <tbody> @forelse ($tickets as $ticket) <tr> <td>{{ $loop->index + 1 }}</td> <td> <p>{{ __('Subject') }}: {{ html_decode($ticket->subject) }} </p> <p>{{ __('Ticket Id') }}: {{ $ticket->ticket_id }}</p> <p>{{ __('Created') }}: {{ $ticket->created_at->format('h:m A, d-M-Y') }}</p> </td> <td> <span class="badge bg-danger">{{ $ticket->unseen_for_user }}</span> </td> <td> @if ($ticket->status == 'pending') <span class="badge bg-danger">{{ __('Pending') }}</span> @elseif ($ticket->status == 'in_progress') <span class="badge bg-success">{{ __('In Progress') }}</span> @elseif ($ticket->status == 'closed') <span class="badge bg-danger">{{ __('Closed') }}</span> @endif </td> <td> <a href="{{ route('admin.support.ticket-show', $ticket->id) }}" class="btn btn-primary btn-sm"><i class="fa fa-eye" aria-hidden="true"></i></a> </td> </tr> @empty <x-empty-table :name="__('Support Tickets')" route="admin.support.ticket" create="no" :message="__('No data found!')" colspan="5"></x-empty-table> @endforelse </tbody> </table> </div> <div class="float-right"> {{ $tickets->links() }} </div> </div> </div> </div> </div> </div> </section> </div> @endsection @push('css') <style> .dd-custom-css { position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, -131px, 0px); } .max-h-400 { min-height: 400px; } </style> @endpush resources/views/ticket_show.blade.php 0000644 00000026446 15012231363 0014025 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Ticket Detail') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Ticket Detail') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Support Tickets') => route('admin.support.ticket'), __('Ticket Detail') => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-md-8"> <div class="card"> <div class="card-header"> <h4>{{ __('Messages') }}</h4> </div> <div class="card-body ticket-message"> <div class="list-group"> @foreach ($messages as $message) @if ($message->admin_id == 0) <div class="mb-2 list-group-item list-group-item-action flex-column align-items-start author_message"> <div class="d-flex w-100 justify-content-between"> <h6 class="mb-1"> {{ $ticket?->user?->name ?? '' }} <small>({{ __('Author') }})</small> </h6> <small>{{ formattedDateTime( $message->created_at) }}</small> </div> <p class="mb-1">{!! html_decode(clean(nl2br($message->message))) !!}</p> @if ($message?->documents) <div class="gallery"> @foreach ($message?->documents as $document) <a href="" class="upload_photo"><i class="fas fa-link"></i> {{ $document->file_name }}</a> @endforeach </div> @endif </div> @else <div class="mb-2 list-group-item list-group-item-action flex-column align-items-start"> <div class="d-flex w-100 justify-content-between"> <h6 class="mb-1">{{ $message?->admin?->name ?? '' }} <small>({{ __('Administrator') }})</small> </h6> <small>{{ formattedDateTime( $message->created_at) }} </small> </div> <p class="mb-1">{!! html_decode(clean(nl2br($message->message))) !!}</p> @if ($message?->documents) <div class="gallery"> @foreach ($message->documents as $document) <a href="" class="upload_photo"><i class="fas fa-link"></i> {{ $document->file_name }}</a> @endforeach </div> @endif </div> @endif @endforeach </div> @if ($ticket->status != 'closed') <div class="mt-4 message-box"> <form @adminCan('support.ticket.manage') action="{{ route('admin.support.store-ticket-message') }}" @endadminCan method="POST" enctype="multipart/form-data"> @csrf <div class="form-group"> <x-admin.form-textarea id="message" name="message" label="{{ __('Type here') }}" placeholder="{{ __('Enter message') }}" value="{{ old('message') }}" maxlength="1000" /> </div> <input type="hidden" value="{{ $ticket->id }}" name="ticket_id"> <input type="hidden" value="{{ $ticket?->user?->id }}" name="user_id"> <div class="form-group"> <input type="file" name="documents[]" multiple class="form-control multi"> <span class="text-danger">{{ __('Maximum file size 2MB') }}</span> </div> @adminCan('support.ticket.manage') <x-admin.button type="submit" :text="__('Submit')" /> @endadminCan </form> </div> @endif </div> </div> </div> <div class="col-md-4"> <div class="card"> <div class="card-body"> <h6>{{ __('Ticket Information') }}</h6> <hr> <p>{{ __('Subject') }}: {{ html_decode($ticket->subject) }}</p> <p>{{ __('Ticket Id') }}: {{ $ticket->ticket_id }}</p> <p>{{ __('Created') }}: {{ $ticket->created_at->format('h:m A, d-M-Y') }}</p> <p>{{ __('Status') }}: @if ($ticket->status == 'pending') <span class="badge bg-danger">{{ __('Pending') }}</span> @elseif ($ticket->status == 'in_progress') <span class="badge bg-success">{{ __('In Progress') }}</span> @elseif ($ticket->status == 'closed') <span class="badge bg-danger">{{ __('Closed') }}</span> @endif </p> <h6 class="mt-3">{{ __('User Information') }}</h6> <hr> @if ($ticket->ticket_from == 'Client') <p> {{ __('Name') }}: {{ $ticket?->user?->name ?? '' }} </p> <p>{{ __('User Type') }} : {{ __('Client') }}</p> <p>{{ __('Email') }} : {{ $ticket?->user?->email ?? '' }}</p> <p>{{ __('Phone') }} : {{ $ticket?->user?->Phone ?? '' }}</p> @else <p> {{ __('Name') }}: {{ $ticket?->user?->name ?? '' }}</a> </p> <p>{{ __('User Type') }} : {{ __('Influencer') }}</p> <p>{{ __('Email') }} : {{ $ticket?->user?->email ?? '' }}</p> <p>{{ __('Phone') }} : {{ $ticket?->user?->Phone ?? '' }}</p> @endif @adminCan('support.ticket.delete') <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#deleteModal" class="btn btn-danger" onclick="deleteData({{ $ticket->id }})"><i class="fa fa-trash" aria-hidden="true"></i> {{ __('Delete') }}</a> @endadminCan @adminCan('support.ticket.close') @if ($ticket->status != 'closed') <a data-bs-toggle="modal" data-bs-target="#closeTicket" href="javascript:;" class="btn btn-danger"><i class="fa fa-times" aria-hidden="true"></i> {{ __('Closed') }}</a> @endif @endadminCan </div> </div> </div> </div> </div> </section> </div> @adminCan('support.ticket.delete') <div class="modal fade" tabindex="-1" role="dialog" id="closeTicket"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Ticket Closed Confirmation') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <p>{{ __('Are You sure closed this ticket ?') }}</p> </div> <div class="modal-footer bg-whitesmoke br"> <form action="{{ route('admin.support.ticket-closed', $ticket->id) }}" method="POST"> @csrf @method('PUT') <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{ __('Close') }}" /> <x-admin.button type="submit" text="{{ __('Yes, Closed') }}" /> </form> </div> </div> </div> </div> @endadminCan <x-admin.delete-modal /> @endsection @push('js') <script src="{{ asset('/backend/js/jquery.MultiFile.min.js') }}" type="text/javascript" language="javascript"></script> <script> "use strict" function deleteData(id) { $("#deleteForm").attr("action", "{{ url('admin/support/ticket-delete') }}" + "/" + id) } </script> @endpush @push('css') @endpush
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка