From da56a253bc907e25b1fa55c6cf6a3ee33bb1cf2c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 2 Nov 2017 04:21:57 -0700 Subject: [PATCH] Added checkout requests method --- app/Http/Controllers/AssetsController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index debaf11855..7daea872c0 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -38,6 +38,7 @@ use Symfony\Component\HttpFoundation\File\Exception\FileException; use TCPDF; use Validator; use View; +use App\Models\CheckoutRequest; /** * This class controls all actions related to assets for @@ -1243,4 +1244,14 @@ class AssetsController extends Controller return redirect()->to("hardware")->with('success', trans('admin/hardware/message.audit.success')); } } + + public function getRequestedIndex($id = null) + { + if ($id) { + $requestedItems = CheckoutRequest::where('user_id', $id)->with('user', 'requestedItem')->get(); + } + $requestedItems = CheckoutRequest::with('user', 'requestedItem')->get(); + return view('hardware/requested', compact('requestedItems')); + } + }