����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.144.19.6 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/gle.gltechlimited.com/app/Http/Controllers/ |
Upload File : |
<?php namespace App\Http\Controllers; use App\Movie; use App\Season; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; class ProtectedVideoController extends Controller { public function video(Request $request) { $movies = Movie::where('is_protect', 1)->where('password', '!=', null)->get(); $seasons = Season::where('is_protect', 1)->where('password', '!=', null)->get(); $result = collect(); foreach ($movies as $movie) { $result->push($movie); } foreach ($seasons as $season) { $result->push($season); } $currentPage = LengthAwarePaginator::resolveCurrentPage(); $itemCollection = collect($result); // Define how many items we want to be visible in each page $perPage = 15; // Slice the collection to get the items to display in current page $currentPageItems = $itemCollection->slice(($currentPage * $perPage) - $perPage, $perPage)->all(); // Create our paginator and pass it to the view $paginatedItems = new LengthAwarePaginator($currentPageItems, count($itemCollection), $perPage); // set url path for generted links $paginatedItems->setPath($request->url()); //return view('protectedPassword',compact('result')); return view('protectedPassword', ['pusheditems' => $paginatedItems]); } }