diff --git a/skolehjem/app/Contact.php b/skolehjem/app/Contact.php index 3c7d017..ce288b7 100644 --- a/skolehjem/app/Contact.php +++ b/skolehjem/app/Contact.php @@ -15,6 +15,6 @@ class Contact extends Model { //protected variable which contains name of database field(s) to be filled. protected $fillable = [ - 'contactname', "title", 'email', 'phone' + 'contactname', "title", 'email', 'phone', 'phonetimes' ]; } diff --git a/skolehjem/app/Http/Controllers/GuideController.php b/skolehjem/app/Http/Controllers/GuideController.php index 084b33e..6635ed1 100644 --- a/skolehjem/app/Http/Controllers/GuideController.php +++ b/skolehjem/app/Http/Controllers/GuideController.php @@ -64,10 +64,10 @@ class GuideController extends Controller $saved = $guide->save(); if(!$saved){ - return Response::detect("guides.store"); + return redirect()->route("guides.store"); }else{ $guide = Guide::query()->paginate($request->input("limit", 20)); - return Response::detect("guides.index", ['guides' => $guide]); + return redirect()->route("guides.index", ['guides' => $guide]); } } diff --git a/skolehjem/database/migrations/2020_06_29_065007_create_contact.php b/skolehjem/database/migrations/2020_06_29_065007_create_contact.php index 9c79bc1..50f79d3 100644 --- a/skolehjem/database/migrations/2020_06_29_065007_create_contact.php +++ b/skolehjem/database/migrations/2020_06_29_065007_create_contact.php @@ -22,7 +22,7 @@ class CreateContact extends Migration $table->string('title', 255); $table->string('email', 255); $table->integer('phone'); - //$table->unique('email'); + $table->string('phonetimes'); }); } diff --git a/skolehjem/resources/views/admin/contacts/create.blade.php b/skolehjem/resources/views/admin/contacts/create.blade.php index c64fefd..632a75a 100644 --- a/skolehjem/resources/views/admin/contacts/create.blade.php +++ b/skolehjem/resources/views/admin/contacts/create.blade.php @@ -10,6 +10,13 @@ @endsection @section("content") + + +

Opret Kontakt:

@csrf @@ -21,6 +28,26 @@ + +
+ + @endsection diff --git a/skolehjem/resources/views/admin/contacts/edit.blade.php b/skolehjem/resources/views/admin/contacts/edit.blade.php index a11e652..8cb2182 100644 --- a/skolehjem/resources/views/admin/contacts/edit.blade.php +++ b/skolehjem/resources/views/admin/contacts/edit.blade.php @@ -10,6 +10,13 @@ @endsection @section("content") + + +

Rediger Kontakt:

$contact]) }}"> @csrf @@ -22,6 +29,26 @@ + +
+ + @endsection diff --git a/skolehjem/resources/views/admin/guides/edit.blade.php b/skolehjem/resources/views/admin/guides/edit.blade.php index 1ae8006..81bcd34 100644 --- a/skolehjem/resources/views/admin/guides/edit.blade.php +++ b/skolehjem/resources/views/admin/guides/edit.blade.php @@ -23,7 +23,7 @@ - + diff --git a/skolehjem/resources/views/app/contacts/index.blade.php b/skolehjem/resources/views/app/contacts/index.blade.php index b02da89..e0c06ee 100644 --- a/skolehjem/resources/views/app/contacts/index.blade.php +++ b/skolehjem/resources/views/app/contacts/index.blade.php @@ -5,6 +5,22 @@ @section("content")
+

Kontakt

+ @if(!$contacts->isEmpty()) + @foreach($contacts as $contact) +

Navn: {{ $contact->contactname }}

+

Email: {{ $contact->email }}

+

{{ $contact->title }}

+ @if($contact->phonetimes) +

Telefontid:

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

Der er ingen kontakter!

+ @endif

Kontakt

Navn: Claus Trasbo

Email: ctr@sde.dk

diff --git a/skolehjem/resources/views/app/guides/index.blade.php b/skolehjem/resources/views/app/guides/index.blade.php index 4d7da8a..09a3303 100644 --- a/skolehjem/resources/views/app/guides/index.blade.php +++ b/skolehjem/resources/views/app/guides/index.blade.php @@ -12,12 +12,13 @@

Vejledninger

- @foreach($guides as $guide) -

{{ $guide->name }}

- {!! $guide->guide_articles !!} -
- @endforeach - @if(count($guides) < 1) + @if(!$guides->isEmpty()) + @foreach($guides as $guide) +

{{ $guide->name }}

+ {!! $guide->guide_articles !!} +
+ @endforeach + @else

Der er ingen vejledninger.

@endif
diff --git a/skolehjem/resources/views/app/layout/base.blade.php b/skolehjem/resources/views/app/layout/base.blade.php index 459971d..b1222a9 100644 --- a/skolehjem/resources/views/app/layout/base.blade.php +++ b/skolehjem/resources/views/app/layout/base.blade.php @@ -45,7 +45,7 @@ Guide - Vejledning + Vejledninger Konto