Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/Refund.tar
Назад
lang/.gitkeep 0000644 00000000000 15012233327 0007102 0 ustar 00 module.json 0000644 00000000332 15012233327 0006720 0 ustar 00 { "name": "Refund", "alias": "refund", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\Refund\\app\\Providers\\RefundServiceProvider" ], "files": [] } tests/Unit/.gitkeep 0000644 00000000000 15012233327 0010242 0 ustar 00 tests/Feature/.gitkeep 0000644 00000000000 15012233327 0010716 0 ustar 00 vite.config.js 0000644 00000001302 15012233327 0007307 0 ustar 00 import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: '../../public/build-refund', emptyOutDir: true, manifest: true, }, plugins: [ laravel({ publicDirectory: '../../public', buildDirectory: 'build-refund', 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 00000000617 15012233327 0006442 0 ustar 00 { "name": "Refund Addon", "is_default": true, "description": "This is Refund 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 15012233327 0007502 0 ustar 00 routes/error_log 0000644 00000001074 15012233327 0010002 0 ustar 00 [08-May-2025 05:24:08 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/Refund/routes/api.php:5 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Refund/routes/api.php on line 5 [08-May-2025 12:29:01 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/Refund/routes/web.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Refund/routes/web.php on line 7 routes/web.php 0000644 00000002536 15012233327 0007357 0 ustar 00 <?php use Illuminate\Support\Facades\Route; use Modules\Refund\app\Http\Controllers\Admin\RefundController as AdminRefundController; use Modules\Refund\app\Http\Controllers\RefundController; Route::group(['middleware' => ['auth:web']], function () { Route::resource('refund-request', RefundController::class)->names('refund-request')->except(['update', 'destroy']); }); Route::group(['as' => 'admin.', 'prefix' => 'admin', 'middleware' => ['auth:admin', 'translation']], function () { Route::controller(AdminRefundController::class)->group(function () { Route::get('/refund-request', 'index')->name('refund-request'); Route::get('/pending-refund-request', 'pending_refund_request')->name('pending-refund-request'); Route::get('/rejected-refund-request', 'rejected_refund_request')->name('rejected-refund-request'); Route::get('/complete-refund-request', 'complete_refund_request')->name('complete-refund-request'); Route::get('/show-refund-request/{id}', 'show')->name('show-refund-request'); Route::delete('/delete-refund-request/{id}', 'destroy')->name('delete-refund-request'); Route::post('/approved-refund-request/{id}', 'approved_refund_request')->name('approved-refund-request'); Route::post('/reject-refund-request/{id}', 'reject_refund_request')->name('reject-refund-request'); }); }); routes/api.php 0000644 00000000206 15012233327 0007343 0 ustar 00 <?php use Illuminate\Support\Facades\Route; Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () {}); composer.json 0000644 00000001267 15012233327 0007272 0 ustar 00 { "name": "nwidart/refund", "description": "", "authors": [ { "name": "Nicolas Widart", "email": "n.widart@gmail.com" } ], "extra": { "laravel": { "providers": [], "aliases": { } } }, "autoload": { "psr-4": { "Modules\\Refund\\": "", "Modules\\Refund\\App\\": "app/", "Modules\\Refund\\Database\\Factories\\": "database/factories/", "Modules\\Refund\\Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Modules\\Refund\\Tests\\": "tests/" } } } config/config.php 0000644 00000000053 15012233327 0007763 0 ustar 00 <?php return [ 'name' => 'Refund', ]; config/.gitkeep 0000644 00000000000 15012233327 0007426 0 ustar 00 package.json 0000644 00000000410 15012233327 0007023 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/.gitkeep 0000644 00000000000 15012233327 0012166 0 ustar 00 app/Http/Controllers/Admin/RefundController.php 0000644 00000007651 15012233327 0015610 0 ustar 00 <?php namespace Modules\Refund\app\Http\Controllers\Admin; use App\Models\User; use Illuminate\Http\Request; use App\Traits\GlobalMailTrait; use App\Http\Controllers\Controller; use Modules\Refund\app\Models\RefundRequest; class RefundController extends Controller { use GlobalMailTrait; public function index() { $refund_requests = RefundRequest::with('user', 'order')->latest()->get(); $title = __('Refund History'); return view('refund::admin.index', ['refund_requests' => $refund_requests, 'title' => $title]); } public function pending_refund_request() { $refund_requests = RefundRequest::with('user', 'order')->where('status', 'pending')->latest()->get(); $title = __('Pending Refund'); return view('refund::admin.index', ['refund_requests' => $refund_requests, 'title' => $title]); } public function rejected_refund_request() { $refund_requests = RefundRequest::with('user', 'order')->where('status', 'rejected')->latest()->get(); $title = __('Rejected Refund'); return view('refund::admin.index', ['refund_requests' => $refund_requests, 'title' => $title]); } public function complete_refund_request() { $refund_requests = RefundRequest::with('user', 'order')->where('status', 'success')->latest()->get(); $title = __('Complete Refund'); return view('refund::admin.index', ['refund_requests' => $refund_requests, 'title' => $title]); } public function show($id) { $refund_request = RefundRequest::with('user', 'order')->findOrFail($id); return view('refund::admin.show', ['refund_request' => $refund_request]); } public function destroy($id) { $refund_request = RefundRequest::findOrFail($id); $refund_request->delete(); $notification = __('Payment approved successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->route('admin.refund-request')->with($notification); } public function approved_refund_request(Request $request, $id) { $request->validate([ 'refund_amount' => 'required|numeric', ], [ 'refund_amount.required' => __('Amount is required'), 'refund_amount.numeric' => __('Amount should be numeric'), ]); $refund_request = RefundRequest::findOrFail($id); $refund_request->refund_amount = $request->refund_amount; $refund_request->status = 'success'; $refund_request->save(); $user = User::findOrFail($refund_request->user_id); //mail send [$subject, $message] = $this->fetchEmailTemplate('approved_refund', ['user_name' => $user->name, 'refund_amount' => $request->refund_amount]); $this->sendMail($user->email, $subject, $message); $notification = __('Refund approved successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function reject_refund_request(Request $request, $id) { $request->validate([ 'subject' => 'required', 'description' => 'required', ], [ 'subject.required' => __('Subject is required'), 'description.required' => __('Description is required'), ]); $refund_request = RefundRequest::findOrFail($id); $refund_request->status = 'rejected'; $refund_request->save(); $user = User::findOrFail($refund_request->user_id); //mail send $message = $request->description; $message = str_replace('[[name]]', $user->name, $message); $this->sendMail($user->email, $request->subject, $message); $notification = __('Refund rejected successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } } app/Http/Controllers/RefundController.php 0000644 00000004711 15012233327 0014552 0 ustar 00 <?php namespace Modules\Refund\app\Http\Controllers; use Illuminate\Http\Request; use App\Traits\GlobalMailTrait; use Modules\Order\app\Models\Order; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; use Modules\Refund\app\Models\RefundRequest; class RefundController extends Controller { use GlobalMailTrait; public function index() { $auth_user = Auth::guard('web')->user(); $refund_requests = RefundRequest::where('user_id', $auth_user->id)->latest()->get(); $order_list = Order::where('user_id', $auth_user->id)->where('payment_status', 'success')->latest()->get(); return view('refund::index', ['refund_requests' => $refund_requests, 'order_list' => $order_list]); } public function store(Request $request) { $request->validate([ 'order_id' => 'required|unique:refund_requests', 'reasone' => 'required', 'account_information' => 'required', ], [ 'order_id.required' => __('Order id is required'), 'reasone.required' => __('Reason is required'), 'account_information.required' => __('Account info is required'), ]); $auth_user = Auth::guard('web')->user(); $new_refund = new RefundRequest(); $new_refund->user_id = $auth_user->id; $new_refund->order_id = $request->order_id; $new_refund->reasone = $request->reasone; $new_refund->account_information = $request->account_information; $new_refund->status = 'pending'; $new_refund->save(); //mail send [$subject, $message] = $this->fetchEmailTemplate('new_refund', ['user_name' => $auth_user->name]); $link = [__('Your Refund Request') => route('admin.show-refund-request', $new_refund->id)]; $this->sendMail($auth_user->email, $subject, $message, $link); return response()->json(['message' => __('Refund request sent successfully')]); } /** * Show the specified resource. */ public function show($id) { $auth_user = Auth::guard('web')->user(); $refund_request = RefundRequest::with('user', 'order')->where('user_id', $auth_user->id)->findOrFail($id); return view('refund::show', ['refund_request' => $refund_request]); } /** * Show the form for editing the specified resource. */ public function edit($id) { return view('refund::edit'); } } app/Http/Requests/.gitkeep 0000644 00000000000 15012233327 0011473 0 ustar 00 app/Http/Middleware/.gitkeep 0000644 00000000000 15012233327 0011735 0 ustar 00 app/Models/.gitkeep 0000644 00000000000 15012233327 0010164 0 ustar 00 app/Models/error_log 0000644 00000000476 15012233327 0010471 0 ustar 00 [07-May-2025 21:58:24 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/Refund/app/Models/RefundRequest.php:11 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Refund/app/Models/RefundRequest.php on line 11 app/Models/RefundRequest.php 0000644 00000001407 15012233327 0012054 0 ustar 00 <?php namespace Modules\Refund\app\Models; use App\Models\User; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Modules\Order\app\Models\Order; use Modules\Refund\Database\factories\RefundRequestFactory; class RefundRequest extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): RefundRequestFactory { //return RefundRequestFactory::new(); } public function user() { return $this->belongsTo(User::class)->select('id', 'name', 'email', 'image'); } public function order() { return $this->belongsTo(Order::class)->select('id', 'order_id'); } } app/Providers/RouteServiceProvider.php 0000644 00000002657 15012233327 0014154 0 ustar 00 <?php namespace Modules\Refund\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\Refund\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('Refund', '/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('Refund', '/routes/api.php')); } } app/Providers/.gitkeep 0000644 00000000000 15012233327 0010716 0 ustar 00 app/Providers/error_log 0000644 00000001304 15012233327 0011212 0 ustar 00 [14-May-2025 16:55:56 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Foundation\Support\Providers\RouteServiceProvider" not found in /home/c7lekhnath/silverray.com.au/Modules/Refund/app/Providers/RouteServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/Refund/app/Providers/RouteServiceProvider.php on line 8 [14-May-2025 16:56:58 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\ServiceProvider" not found in /home/c7lekhnath/silverray.com.au/Modules/Refund/app/Providers/RefundServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/c7lekhnath/silverray.com.au/Modules/Refund/app/Providers/RefundServiceProvider.php on line 8 app/Providers/RefundServiceProvider.php 0000644 00000006436 15012233327 0014300 0 ustar 00 <?php namespace Modules\Refund\app\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; class RefundServiceProvider extends ServiceProvider { protected string $moduleName = 'Refund'; protected string $moduleNameLower = 'refund'; /** * 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 15012233327 0011704 0 ustar 00 database/migrations/.gitkeep 0000644 00000000000 15012233327 0012101 0 ustar 00 database/migrations/2023_11_30_041502_create_refund_requests_table.php 0000644 00000001551 15012233327 0021171 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('refund_requests', function (Blueprint $table) { $table->id(); $table->integer('user_id'); $table->integer('order_id'); $table->decimal('refund_amount', 8, 2)->default(0.00); $table->text('reasone'); $table->text('account_information'); $table->enum('status', ['pending', 'rejected', 'success'])->default('pending'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('refund_requests'); } }; database/seeders/.gitkeep 0000644 00000000000 15012233327 0011357 0 ustar 00 database/seeders/RefundDatabaseSeeder.php 0000644 00000000371 15012233327 0014452 0 ustar 00 <?php namespace Modules\Refund\database\seeders; use Illuminate\Database\Seeder; class RefundDatabaseSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } resources/assets/.gitkeep 0000644 00000000000 15012233327 0011475 0 ustar 00 resources/assets/js/app.js 0000644 00000000000 15012233327 0011576 0 ustar 00 resources/assets/sass/app.scss 0000644 00000000000 15012233327 0012472 0 ustar 00 resources/views/show.blade.php 0000644 00000001750 15012233327 0012453 0 ustar 00 <table class="table table-striped"> <tr> <td>{{ __('Order Id') }}</td> <td>#<a target="_blank" href="">{{ $refund_request?->order?->order_id }}</a> </td> </tr> <tr> <td>{{ __('Reason') }}</td> <td>{!! nl2br($refund_request->reasone) !!}</td> </tr> <tr> <td>{{ __('Account information for received amount') }}</td> <td>{!! nl2br($refund_request->account_information) !!}</td> </tr> @if ($refund_request->status == 'success') <tr> <td>{{ __('Refund amount') }}</td> <td>{{ currency($refund_request->refund_amount) }}</td> </tr> @endif <tr> <td>{{ __('Status') }}</td> <td> @if ($refund_request->status == 'success') {{ __('Success') }} @elseif ($refund_request->status == 'rejected') {{ __('Rejected') }} @else {{ __('Pending') }} @endif </td> </tr> </table> resources/views/admin/sidebar.blade.php 0000644 00000002264 15012233327 0014175 0 ustar 00 <li class="nav-item dropdown {{ isRoute(['admin.refund-request', 'admin.pending-refund-request', 'admin.show-refund-request', 'admin.rejected-refund-request', 'admin.complete-refund-request'], 'active') }}"> <a href="#" class="nav-link has-dropdown" data-toggle="dropdown"><i class="fas fa-undo"></i> <span>{{ __('Manage Refund') }} </span> </a> <ul class="dropdown-menu"> <li class="{{ isRoute('admin.refund-request', 'active') }}"><a class="nav-link" href="{{ route('admin.refund-request') }}">{{ __('Refund History') }}</a></li> <li class="{{ isRoute('admin.pending-refund-request', 'active') }}"><a class="nav-link" href="{{ route('admin.pending-refund-request') }}">{{ __('Pending Refund') }}</a></li> <li class="{{ isRoute('admin.rejected-refund-request', 'active') }}"><a class="nav-link" href="{{ route('admin.rejected-refund-request') }}">{{ __('Rejected Refund') }}</a></li> <li class="{{ isRoute('admin.complete-refund-request', 'active') }}"><a class="nav-link" href="{{ route('admin.complete-refund-request') }}">{{ __('Complete Refund') }}</a></li> </ul> </li> resources/views/admin/show.blade.php 0000644 00000023124 15012233327 0013542 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Refund Request') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Refund Request') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Refund Request') => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-12 col-md-12 col-lg-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="table table-striped"> <tr> <td>{{ __('User') }}</td> <td><a href="{{ route('admin.customer-show', $refund_request->user_id) }}">{{ $refund_request?->user?->name }}</a> </td> </tr> <tr> <td>{{ __('Order Id') }}</td> <td>#<a target="_blank" href="{{ route('admin.order', $refund_request?->order?->order_id) }}">{{ $refund_request?->order?->order_id }}</a> </td> </tr> <tr> <td>{{ __('Reason') }}</td> <td>{!! nl2br($refund_request->reasone) !!}</td> </tr> <tr> <td>{{ __('Account information for received amount') }}</td> <td>{!! nl2br($refund_request->account_information) !!}</td> </tr> @if ($refund_request->status == 'success') <tr> <td>{{ __('Refund amount') }}</td> <td>{{ currency($refund_request->refund_amount) }}</td> </tr> @endif <tr> <td>{{ __('Status') }}</td> <td> @if ($refund_request->status == 'success') <div class="badge bg-success">{{ __('Success') }}</div> @elseif ($refund_request->status == 'rejected') <div class="badge bg-danger">{{ __('Rejected') }}</div> @else <div class="badge bg-danger">{{ __('Pending') }}</div> @endif </td> </tr> </table> </div> @if ($refund_request->status == 'pending') <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#rejectRefund" class="btn btn-danger">{{ __('Make refund rejected') }}</a> @endif @if ($refund_request->status == 'rejected' || $refund_request->status == 'pending') <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#approveRefund" class="btn btn-success">{{ __('Make approved refund') }}</a> @endif <a href="" data-url="{{ route('admin.delete-refund-request', $refund_request->id) }}" class="btn btn-danger delete">{{ __('Delete request') }}</a> </div> </div> </div> </div> </div> </section> </div> {{-- delete modal --}} <div class="modal fade" tabindex="-1" role="dialog" id="delete"> <div class="modal-dialog" role="document"> <form action="" method="POST"> @csrf @method('DELETE') <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Delete refund request') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <p class="text-danger">{{ __('Are You Sure to Delete this refund ?') }}</p> </div> <div class="modal-footer"> <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{ __('Close') }}" /> <x-admin.button type="submit" text="{{ __('Yes, Delete') }}" /> </div> </div> </form> </div> </div> <!--Refund Approved Modal --> <div class="modal fade" id="approveRefund" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Refund Approval') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <div class="container-fluid"> <form action="{{ route('admin.approved-refund-request', $refund_request->id) }}" method="POST"> @csrf <div class="form-group"> <label for="">{{ __('Refund Amount') }} <span data-toggle="tooltip" data-placement="top" class="fa fa-info-circle text--primary" title="Amount should be USD($)"></label> <input type="text" name="refund_amount" class="form-control" autocomplete="off"> </div> </div> </div> <div class="modal-footer"> <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{ __('Close') }}" /> <x-admin.button type="submit" text="{{ __('Save Data') }}" /> </div> </form> </div> </div> </div> <!--Payment Refund Modal --> <div class="modal fade" id="rejectRefund" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Refund Reject') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <div class="container-fluid"> <form action="{{ route('admin.reject-refund-request', $refund_request->id) }}" method="POST"> @csrf <div class="form-group"> <label for="">{{ __('Subject') }}</label> <input type="text" name="subject" class="form-control"> </div> @php($default_value = '[[name]]') <div class="form-group"> <label for="">{{ __('Description') }} <span data-toggle="tooltip" data-placement="top" class="fa fa-info-circle text--primary" title="Don't remove the [[name]] keyword, user name will be dynamic using it"> </label> <textarea name="description" class="form-control text-area-5" cols="30" rows="10">{{ 'Dear ' . $default_value }}</textarea> </div> </div> </div> <div class="modal-footer"> <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{ __('Close') }}" /> <x-admin.button type="submit" text="{{ __('Save Data') }}" /> </div> </form> </div> </div> </div> @push('js') <script> $(function() { 'use strict' $('.delete').on('click', function(e) { e.preventDefault(); const modal = $('#delete'); modal.find('form').attr('action', $(this).data('url')); modal.modal('show'); }) }) </script> @endpush @endsection resources/views/admin/index.blade.php 0000644 00000012524 15012233327 0013673 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ $title }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ $title }}" :list="[ __('Dashboard') => route('admin.dashboard'), $title => '#', ]" /> <div class="section-body"> <div class="row"> <div class="col-12 col-md-12 col-lg-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="table table-striped"> <thead> <th>{{ __('SN') }}</th> <th>{{ __('User') }}</th> <th>{{ __('Order Id') }}</th> <th>{{ __('Status') }}</th> <th>{{ __('Action') }}</th> </thead> @forelse ($refund_requests as $index => $refund_request) <tr> <td>{{ ++$index }}</td> <td><a href="{{ route('admin.customer-show', $refund_request->user_id) }}">{{ $refund_request?->user?->name }}</a> </td> <td>#<a target="_blank" href="{{ route('admin.order', $refund_request?->order?->order_id) }}">{{ $refund_request?->order?->order_id }}</a> </td> <td> @if ($refund_request->status == 'success') <div class="badge bg-success">{{ __('Success') }}</div> @elseif ($refund_request->status == 'rejected') <div class="badge bg-danger">{{ __('Rejected') }}</div> @else <div class="badge bg-danger">{{ __('Pending') }}</div> @endif </td> <td> <a href="{{ route('admin.show-refund-request', $refund_request->id) }}" class="btn btn-primary btn-sm"><i class="fa fa-eye"></i></a> <a href="" data-url="{{ route('admin.delete-refund-request', $refund_request->id) }}" class="btn btn-danger btn-sm delete"><i class="fa fa-trash"></i></a> </td> </tr> @empty <x-empty-table :name="__('Customer')" route="" create="no" :message="__('No data found!')" colspan="5"></x-empty-table> @endforelse </table> </div> </div> </div> </div> </div> </div> </section> </div> <div class="modal fade" tabindex="-1" role="dialog" id="delete"> <div class="modal-dialog" role="document"> <form action="" method="POST"> @csrf @method('DELETE') <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Delete refund request') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <p class="text-danger">{{ __('Are You Sure to Delete this refund ?') }}</p> </div> <div class="modal-footer"> <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{__('Close')}}"/> <x-admin.button type="submit" text="{{__('Yes, Delete')}}"/> </div> </div> </form> </div> </div> @push('js') <script> $(function() { 'use strict' $('.delete').on('click', function(e) { e.preventDefault(); const modal = $('#delete'); modal.find('form').attr('action', $(this).data('url')); modal.modal('show'); }) }) </script> @endpush @endsection resources/views/.gitkeep 0000644 00000000000 15012233327 0011330 0 ustar 00 resources/views/index.blade.php 0000644 00000006723 15012233327 0012607 0 ustar 00 <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <title>Refund Request Module</title> </head> <body> <div class="container"> <h1 class="text-center">Refund Request Module</h1> <div class="card text-left"> <div class="card-body"> <h4 class="card-title">Refund form</h4> <form action="{{ route('refund-request.store') }}" method="POST"> @csrf <div class="form-group"> <label for="">Order Id <small>(Only paid order will be visible)</small></label> <select name="order_id" id="" class="form-control"> <option value="">Select</option> @foreach ($order_list as $order) <option value="{{ $order->id }}">{{ $order->order_id }}</option> @endforeach </select> </div> <div class="form-group"> <label for="">Reason</label> <textarea name="reasone" class="form-control" id="" cols="30" rows="3"></textarea> </div> <div class="form-group"> <label for="">Bank info for refun amount</label> <textarea name="account_information" class="form-control" id="" cols="30" rows="3"></textarea> </div> <button class="btn btn-primary">{{ __('Submit') }}</button> </form> </div> </div> <table class="table table-striped"> <thead> <th>{{ __('SN') }}</th> <th>{{ __('Order Id') }}</th> <th>{{ __('Status') }}</th> <th>{{ __('Action') }}</th> </thead> @foreach ($refund_requests as $index => $refund_request) <tr> <td>{{ ++$index }}</td> <td>#<a target="_blank" href="">{{ $refund_request?->order?->order_id }}</a> </td> <td> @if ($refund_request->status == 'success') {{ __('Success') }} @elseif ($refund_request->status == 'rejected') {{ __('Rejected') }} @else {{ __('Pending') }} @endif </td> <td> <a href="{{ route('refund-request.show', $refund_request->id) }}" class="btn btn-primary btn-sm">Details</a> </td> </tr> @endforeach </table> </div> <!-- Optional JavaScript; choose one of the two! --> <!-- Option 1: Bootstrap Bundle with Popper --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"> </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка