From 76bea82eea25fc96fbae3f5440e36bc6c172a7e0 Mon Sep 17 00:00:00 2001 From: frederikpyt Date: Wed, 5 Aug 2020 13:29:45 +0200 Subject: [PATCH] v0.5.1 - Made contact phone number optional and updated data in seeders. --- skolehjem/app/Http/Controllers/ContactController.php | 2 +- skolehjem/database/seeds/ContactSeeder.php | 10 +++++----- .../resources/views/admin/contacts/create.blade.php | 2 +- .../resources/views/admin/contacts/edit.blade.php | 2 +- skolehjem/resources/views/app/contacts/index.blade.php | 6 ++++-- .../resources/views/app/feedbacks/create.blade.php | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/skolehjem/app/Http/Controllers/ContactController.php b/skolehjem/app/Http/Controllers/ContactController.php index 7251f4b..e3e706c 100644 --- a/skolehjem/app/Http/Controllers/ContactController.php +++ b/skolehjem/app/Http/Controllers/ContactController.php @@ -57,7 +57,7 @@ class ContactController extends Controller "contactname" => "required|max:255", "title" => "required|max:255", "email" => "required|max:255", - "phone" => "required|max:255", + "phone" => "max:255", ]); $contact = new Contact($requestContact); diff --git a/skolehjem/database/seeds/ContactSeeder.php b/skolehjem/database/seeds/ContactSeeder.php index e18c5c1..1d60ba7 100644 --- a/skolehjem/database/seeds/ContactSeeder.php +++ b/skolehjem/database/seeds/ContactSeeder.php @@ -23,35 +23,35 @@ class ContactSeeder extends Seeder 'contactname' => "Birgitte True", 'email' => "bit@sde.dk", 'title' => "", - 'phone' => "40886515", + 'phone' => "63126715", 'phonetimes' => "

Mandag-Torsdag: 8.00-15.00
Fredag: 8.00-12.00

", ], [ 'contactname' => "Thomas Thomsen", 'email' => "thth@sde.dk", 'title' => "Kollegieassistent", - 'phone' => "24629450", + 'phone' => "", 'phonetimes' => "", ], [ 'contactname' => "Anja Holm Brix", 'email' => "ahb@sde.dk", 'title' => "Kollegieassistent", - 'phone' => "24629450", + 'phone' => "", 'phonetimes' => "", ], [ 'contactname' => "Britta Overgaard Brink Olsen", 'email' => "brio@sde.dk", 'title' => "Kollegieassistent", - 'phone' => "24629450", + 'phone' => "", 'phonetimes' => "", ], [ 'contactname' => "Jesper Sandberg", 'email' => "jesa@sde.dk", 'title' => "Kollegieassistent", - 'phone' => "24629450", + 'phone' => "", 'phonetimes' => "", ], ]; diff --git a/skolehjem/resources/views/admin/contacts/create.blade.php b/skolehjem/resources/views/admin/contacts/create.blade.php index 947c007..243d360 100644 --- a/skolehjem/resources/views/admin/contacts/create.blade.php +++ b/skolehjem/resources/views/admin/contacts/create.blade.php @@ -27,7 +27,7 @@ - + diff --git a/skolehjem/resources/views/admin/contacts/edit.blade.php b/skolehjem/resources/views/admin/contacts/edit.blade.php index afc0a5a..acaf58d 100644 --- a/skolehjem/resources/views/admin/contacts/edit.blade.php +++ b/skolehjem/resources/views/admin/contacts/edit.blade.php @@ -28,7 +28,7 @@ - + diff --git a/skolehjem/resources/views/app/contacts/index.blade.php b/skolehjem/resources/views/app/contacts/index.blade.php index c5e39df..50a2741 100644 --- a/skolehjem/resources/views/app/contacts/index.blade.php +++ b/skolehjem/resources/views/app/contacts/index.blade.php @@ -15,8 +15,10 @@

Telefontid:

{!! $contact->phonetimes !!} @endif - +45 {{ chunk_split($contact->phone, 2, ' ') }} - Ring + @if($contact->phone) + +45 {{ chunk_split($contact->phone, 2, ' ') }} + Ring + @endif @endforeach @else

Der er ingen kontakter!

diff --git a/skolehjem/resources/views/app/feedbacks/create.blade.php b/skolehjem/resources/views/app/feedbacks/create.blade.php index 766e94e..7d6cdbf 100644 --- a/skolehjem/resources/views/app/feedbacks/create.blade.php +++ b/skolehjem/resources/views/app/feedbacks/create.blade.php @@ -13,7 +13,7 @@ - +