/home/kueuepay/public_html/app/Http/Controllers/User/TransactionLogController.php
<?php

namespace App\Http\Controllers\User;

use App\Constants\PaymentGatewayConst;
use App\Models\Transaction;
use Illuminate\Http\Request;
use App\Http\Helpers\Response;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;

class TransactionLogController extends Controller
{
    /**
     * Method for view transaction log page
     * @return view
     */
    public function cardPayment(){
        $page_title     = "Payment Logs";
        $transactions   = Transaction::with(['card_method'])->where('type',PaymentGatewayConst::CARD_PAYMENT)->auth()->orderBy('id','desc')->get();

        return view('user.sections.transaction.index',compact(
            'page_title',
            'transactions'
        ));
    }
    /**
     * Method for search trasaction data
     */
    public function search(Request $request){
       
        $validator      = Validator::make($request->all(),[
            'text'      => 'required'
        ]);
        if($validator->fails()) {
            $error = ['error' => $validator->errors()];
            return Response::error($error,null,400);
        }

        $validated = $validator->validate();
        
        $transactions    = Transaction::auth()->search($validated['text'])->get();
        return view('user.components.transaction.index',compact('transactions'));
    }
    /**
     * Method for view add money transaction log page
     * @return view
     */
    public function addMoney(){
        $page_title     = "Add Money Logs";

        $transactions   = Transaction::auth()->with(['payment_gateway'])->where('type',PaymentGatewayConst::TYPEADDMONEY)
                            ->orderBy('id','desc')->get();
        return view('user.sections.transaction.index',compact(
            'page_title',
            'transactions'
        ));
    }
    /**
     * Method for view transfer money transaction log page
     * @return view
     */
    public function transferMoney(){
        $page_title     = "Transfer Money Logs";

        $transactions   = Transaction::auth()->with(['payment_gateway'])->where('type',PaymentGatewayConst::TYPETRANSFERMONEY)
                            ->orderBy('id','desc')->get();
        return view('user.sections.transaction.index',compact(
            'page_title',
            'transactions'
        ));
    }
    
}
Contact
top

Get in Touch with Us for Any Questions or Support

We’d love to hear from you! Whether you have questions, feedback, or need support, our team is here to help. Reach out to us via email, phone, or visit our office. We’re committed to providing you with exceptional service and ensuring your experience with NFC Pay is seamless and satisfying. Let’s connect!

icon

Our Location

20-22 Wenlock Road, England, N1 7GU
icon

Call us on: +03601 885399

Our office hours Monday–Friday, 9am - 9pm
icon

Email us directly

support@example.com