shell bypass 403

UnknownSec Shell


name : BecomeInstructorController.php
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Accounting;
use App\Models\BecomeInstructor;
use App\Models\Order;
use App\Models\RegistrationPackage;
use App\Models\Role;
use App\Models\Sale;

class BecomeInstructorController extends Controller
{
    public function index($page)
    {
        $this->authorize('admin_become_instructors_list');

        if ($page == 'organizations') {
            $role = Role::$organization;
        } else {
            $role = Role::$teacher;
        }

        $query = BecomeInstructor::where('role', $role);

        if (getRegistrationPackagesGeneralSettings('force_user_to_select_a_package')) {
            $query->whereNotNull('package_id');
        }

        $becomeInstructors = $query->with(['user', 'registrationPackage'])
            ->orderBy('created_at', 'desc')
            ->paginate(10);

        $data = [
            'pageTitle' => trans('admin/main.become_instructors_list'),
            'becomeInstructors' => $becomeInstructors
        ];

        return view('admin.users.become_instructors.lists', $data);
    }

    public function reject($id)
    {
        $this->authorize('admin_become_instructors_reject');

        $becomeInstructors = BecomeInstructor::findOrFail($id);

        $this->handleRefundPackage($becomeInstructors);

        $becomeInstructors->update([
            'status' => 'reject'
        ]);

        // Send Notification
        $becomeInstructors->sendNotificationToUser('reject');

        return redirect()->back();
    }

    public function delete($id)
    {
        $this->authorize('admin_become_instructors_delete');

        $becomeInstructors = BecomeInstructor::findOrFail($id);

        $this->handleRefundPackage($becomeInstructors);

        $becomeInstructors->delete();

        return redirect()->back();
    }

    private function handleRefundPackage($becomeInstructors)
    {
        if (!empty($becomeInstructors->package_id)) {
            $sale = Sale::where('buyer_id', $becomeInstructors->user_id)
                ->where('type', Sale::$registrationPackage)
                ->where('registration_package_id', $becomeInstructors->package_id)
                ->whereNull('refund_at')
                ->first();

            if (!empty($sale)) {
                if (!empty($sale->total_amount)) {

                    Accounting::refundAccounting($sale);
                }

                $sale->update(['refund_at' => time()]);
            }
        }
    }
}

© 2025 UnknownSec
Courses | Anyleson - Learning Platform
INR (₹)
India Rupee
$
United States Dollar

Courses

17 Courses
Course
Full Stack Web Development

Full Stack Web Development

in Web Development
83:20 Hours
10 Oct 2024
₹28,318.82
Course
Installment and Secure Host

Installment and Secure Host

in Business Strategy
5.00
1:30 Hours
16 Mar 2023
₹118
Course
New Update Features

New Update Features

in Language
4.00
1:30 Hours
21 Jun 2022
Free
Not conducted
Bestseller
New In-App Live System

New In-App Live System

in Communications
5.00
2:30 Hours
1 Mar 2026
₹11.80
Featured
New Learning Page

New Learning Page

in Lifestyle
5.00
3:30 Hours
1 Mar 2022
Free
Finished
How to Travel Around the World

How to Travel Around the World

in Lifestyle
5.00
2:30 Hours
2 Mar 2022
₹29.50

Type

More options