From 0608094039f10b8228a8bd602e5aaede0d87f7af Mon Sep 17 00:00:00 2001 From: Lukas Halbritter Date: Sun, 9 Sep 2018 10:01:37 +0200 Subject: [PATCH] Added views for indexing all people and showing a single one. Added a method to get all (sub-)bookings associated with a person-target. --- app/PersonTarget.php | 10 +++- resources/views/people/index.blade.php | 4 +- resources/views/people/show.blade.php | 67 ++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) diff --git a/app/PersonTarget.php b/app/PersonTarget.php index a844fdf..aa47ae4 100644 --- a/app/PersonTarget.php +++ b/app/PersonTarget.php @@ -6,5 +6,13 @@ use Illuminate\Database\Eloquent\Model; class PersonTarget extends Model { - // + /* + * Get all bookings associated with a target. + * + * @return Illuminate\Database\Eloquent\Collection + */ + public function getBookings() + { + return $this->hasMany('\App\SubBooking')->get(); + } } diff --git a/resources/views/people/index.blade.php b/resources/views/people/index.blade.php index 7c8a364..cbf8071 100644 --- a/resources/views/people/index.blade.php +++ b/resources/views/people/index.blade.php @@ -24,7 +24,9 @@ {{ $person->email }} {{ $person->mobile }} {{ $person->phone }} - + + Anzeigen + @endforeach diff --git a/resources/views/people/show.blade.php b/resources/views/people/show.blade.php index e69de29..dbc65c2 100644 --- a/resources/views/people/show.blade.php +++ b/resources/views/people/show.blade.php @@ -0,0 +1,67 @@ +

Stammdaten

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID{{ $person->id }}
Anrede{{ $person->title }}
Name / Firma{{ $person->name_or_company }}
Vorname{{ $person->surname }}
Straße{{ $person->street }}
Postleitzahl{{ $person->postal_code }}
Ort{{ $person->city }}
E-Mail{{ $person->email }}
Telefon{{ $person->phone }}
Mobil{{ $person->mobile }}
Geburtstage{{ $person->date_of_birth }}
+ + +

Konto

+ + + + + + + + + @foreach ($targets as $target) + + + + + + @endforeach +
 DatumZweckSollIst
> + {{ $target->date }}{{ $target->reference }}{{ $target->amount }}