OwlCyberSecurity - MANAGER
Edit File: PublicController.php
<?php namespace App\Http\Controllers; use App\Sportpesa\Modules\Blog\Model\Blog; use App\Sportpesa\Modules\Prediction\Model\Prediction; use App\Sportpesa\Modules\Slider\Model\Slider; use App\Helpers\JSONResponder; use App\Mail\ContactEmail; use App\Sportpesa\Modules\Subscription\Model\Subscription; use App\Sportpesa\Modules\User\Model\User; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Mail\Mailer; use Illuminate\Support\Facades\Session; class PublicController extends Controller { public function getIndex() { return redirect('/'); } public function getHome(Slider $slider, Prediction $prediction, Blog $blog) { $sliderF = $slider->where('status', '1')->orderBy('created_at', 'DESC')->get(); $sliderS = $slider->where('status', '2')->orderBy('created_at', 'DESC')->get(); $freeYesterday = $prediction->yesterdayGame()->where('freePick', 'Yes')->get(); $freeToday = $prediction->todayGame()->where('freePick', 'Yes')->get(); $freeTomorrow = $prediction->today1Game()->where('freePick', 'Yes')->get(); $testimonials = $prediction->where('display', '0')->where('testimonial', '1')->where('testimonialValue', '!=', '')->take(15)->orderBy('updated_at', 'DESC')->get(); return view('welcome', compact('sliderF', 'sliderS', 'freeYesterday', 'freeToday', 'freeTomorrow', 'testimonials')); } public function getWinnings(Prediction $prediction) { $testimonials = $prediction->where('display', '0')->where('testimonial', '1')->where('testimonialValue', '!=', '')->orderBy('updated_at', 'DESC')->paginate(20); return view('winnings', compact('testimonials')); } public function getBlog($slug=null, Blog $blog) { if ($slug!=null) { $article = $blog->where('slug', $slug)->first(); if (count($article)>0) return view('article', compact('article')); return redirect()->back(); } $posts = $blog->where('status', 'Publish')->where('category', '!=', 'Preview')->orderBy('id', 'DESC')->paginate(8); return view('blog', compact('posts')); } public function getPreviews($slug=null, Blog $blog) { if ($slug!=null) { $article = $blog->where('slug', $slug)->first(); if (count($article)>0) return view('article', compact('article')); return redirect()->back(); } $posts = $blog->where('status', 'Publish')->where('category', 'Preview')->orderBy('id', 'DESC')->paginate(8); return view('previews', compact('posts')); } public function postContact(Request $request, Mailer $mailer) { $data = $request->except('_token'); $mailer->to(env('MAIL_TO_ADDRESS'))->send(new ContactEmail($data)); JSONResponder::validationMessage('Ok', '0'); } public function getVIP(Subscription $subscription){ $premium = $subscription->where('category', 'Premium')->get(); $super = $subscription->where('category', 'Super')->get(); $bankroll = $subscription->where('category', 'Bankroll')->get(); $smart = $subscription->where('category', 'Smart')->get(); $HTFT = $subscription->where('category', 'HTFT')->get(); $correct_score = $subscription->where('category', 'Correct Score')->get(); $investment = $subscription->where('category', 'Investment')->get(); $jackpot = $subscription->where('category', 'Sportpesa')->orWhere('category', 'Mbet')->get(); $whatsapp = $subscription->where('category', 'WhatsApp')->get(); return view('plan', compact('premium', 'super', 'HTFT', 'bankroll', 'whatsapp', 'smart', 'correct_score', 'jackpot', 'investment')); } public function getCountry() { $url = Session::get('subRoute'); $noAd = true; return view('country', compact('url', 'noAd')); } public function postCountry(Request $request) { $country = $request->country; User::where('id', currentUser()->id)->update(['country'=>$country]); JSONResponder::validationMessage('Ok', '0'); } }