From b555af06c7eb94daf87cdb0965ff0f5aca33a1f0 Mon Sep 17 00:00:00 2001 From: Neerholt Date: Mon, 29 Jun 2020 10:30:09 +0200 Subject: [PATCH] Lavet contact create controller --- skolehjem/app/Contact.php | 4 +++- .../app/Http/Controllers/ContactController.php | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/skolehjem/app/Contact.php b/skolehjem/app/Contact.php index c035b2a..5570122 100644 --- a/skolehjem/app/Contact.php +++ b/skolehjem/app/Contact.php @@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Contact extends Model { - // + protected $fillable = [ + 'monday', "tuesday", 'wednesday', 'thursday', "friday", "saturday", "sunday" + ]; } diff --git a/skolehjem/app/Http/Controllers/ContactController.php b/skolehjem/app/Http/Controllers/ContactController.php index 63eea17..5da67c6 100644 --- a/skolehjem/app/Http/Controllers/ContactController.php +++ b/skolehjem/app/Http/Controllers/ContactController.php @@ -28,7 +28,8 @@ class ContactController extends Controller */ public function create() { - // + return Response::detect("contacts.create"); + } /** @@ -39,7 +40,15 @@ class ContactController extends Controller */ public function store(Request $request) { - // + $requestContact = $request->validate([ + "idk kev" => "required|max:255", + + ]); + + $contact = new MenuPlan($requestContact); + $contact->save(); + + return Response::detect("contacts.store"); } /**