From 42aa2b5c83e7204e5add17c755a24bda28427c80 Mon Sep 17 00:00:00 2001 From: Anders Date: Mon, 29 Jun 2020 13:18:39 +0200 Subject: [PATCH 1/2] Renamed contact to contacts in app --- .../resources/views/app/{contact => contacts}/index.blade.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename skolehjem/resources/views/app/{contact => contacts}/index.blade.php (100%) diff --git a/skolehjem/resources/views/app/contact/index.blade.php b/skolehjem/resources/views/app/contacts/index.blade.php similarity index 100% rename from skolehjem/resources/views/app/contact/index.blade.php rename to skolehjem/resources/views/app/contacts/index.blade.php From c6ffa26baa9e84e69e9ed9f2be0e99120fd5440d Mon Sep 17 00:00:00 2001 From: frederikpyt Date: Mon, 29 Jun 2020 13:18:58 +0200 Subject: [PATCH 2/2] Fixes --- skolehjem/app/Http/Controllers/ContactController.php | 7 ++++--- skolehjem/resources/views/admin/contacts/index.blade.php | 2 +- .../resources/views/admin/menuplans/index.blade.php | 9 +-------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/skolehjem/app/Http/Controllers/ContactController.php b/skolehjem/app/Http/Controllers/ContactController.php index eb5c1f0..426f335 100644 --- a/skolehjem/app/Http/Controllers/ContactController.php +++ b/skolehjem/app/Http/Controllers/ContactController.php @@ -98,10 +98,11 @@ class ContactController extends Controller /** * Remove the specified resource from storage. * - * @param int $id - * @return \Illuminate\Http\Response + * @param int $id + * @return \Illuminate\Http\RedirectResponse + * @throws \Exception */ - public function destroy($id) + public function destroy(Contact $id) { $id->delete(); return redirect()->route("contacts.index"); diff --git a/skolehjem/resources/views/admin/contacts/index.blade.php b/skolehjem/resources/views/admin/contacts/index.blade.php index 36b034a..f277ce0 100644 --- a/skolehjem/resources/views/admin/contacts/index.blade.php +++ b/skolehjem/resources/views/admin/contacts/index.blade.php @@ -26,7 +26,7 @@ {{ $contact->email }} {{ $contact->phone }} $contact ]) }}">Update - $contact ]) }}">Delete + $contact ]) }}">Delete @endforeach diff --git a/skolehjem/resources/views/admin/menuplans/index.blade.php b/skolehjem/resources/views/admin/menuplans/index.blade.php index e165a9b..5acdd7c 100644 --- a/skolehjem/resources/views/admin/menuplans/index.blade.php +++ b/skolehjem/resources/views/admin/menuplans/index.blade.php @@ -26,14 +26,7 @@ {{$menuplan->wednesday}} {{$menuplan->thursday}} $menuplan ]) }}">Update - -
$menuplan ]) }}" class="w-100"> - @csrf - @method("delete") - - -
- + $menuplan ]) }}">Delete @endforeach