From acdd9c936cb01beb0e63e71f9ee47f020eaffcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 18 Aug 2020 14:38:46 +0200 Subject: [PATCH] Fix route model binding --- app/Http/Controllers/ClientPortal/DownloadController.php | 6 ++---- .../ninja2020/components/livewire/downloads-table.blade.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/DownloadController.php b/app/Http/Controllers/ClientPortal/DownloadController.php index 00682336c0c8..6896fd43f15b 100644 --- a/app/Http/Controllers/ClientPortal/DownloadController.php +++ b/app/Http/Controllers/ClientPortal/DownloadController.php @@ -32,12 +32,10 @@ class DownloadController extends Controller /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function show(ShowDocumentRequest $request, $document) + public function show(ShowDocumentRequest $request, Document $download) { - $document = Document::findOrFail($document); - return render('downloads.show', [ - 'document' => $document, + 'document' => $download, ]); } } diff --git a/resources/views/portal/ninja2020/components/livewire/downloads-table.blade.php b/resources/views/portal/ninja2020/components/livewire/downloads-table.blade.php index 231c60b2703b..bc99dacc442e 100644 --- a/resources/views/portal/ninja2020/components/livewire/downloads-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/downloads-table.blade.php @@ -72,7 +72,7 @@ - + {{ ctrans('texts.view') }}