diff --git a/app/Http/Controllers/PeopleController.php b/app/Http/Controllers/PeopleController.php new file mode 100644 index 0000000..9ce7ef2 --- /dev/null +++ b/app/Http/Controllers/PeopleController.php @@ -0,0 +1,22 @@ +get(); + + return view('people.index', compact('people')); + } + + public function show(Person $person) + { + return view('people.show', compact('person')); + } +} diff --git a/database/migrations/2018_09_03_090023_create_people_table.php b/database/migrations/2018_09_03_090023_create_people_table.php index 4429b07..53775f6 100644 --- a/database/migrations/2018_09_03_090023_create_people_table.php +++ b/database/migrations/2018_09_03_090023_create_people_table.php @@ -22,7 +22,7 @@ class CreatePeopleTable extends Migration $table->string('surname')->nullable(); // Date of birth - $table->date('date_of_birth')->nullable(); + $table->date('date_of_birth')->nullable()->default(); // Adress $table->string('city')->nullable(); diff --git a/resources/views/people/index.blade.php b/resources/views/people/index.blade.php new file mode 100644 index 0000000..7c8a364 --- /dev/null +++ b/resources/views/people/index.blade.php @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + @foreach ($people as $person) + + + + + + + + + + + + + + @endforeach +
IDTitelName / FirmaVornameStraßePLZOrtE-MailHandyTelefonAktionen
{{ $person->id }}{{ $person->title }}{{ $person->name_or_company }}{{ $person->surname }}{{ $person->street }}{{ $person->postal_code }}{{ $person->city }}{{ $person->email }}{{ $person->mobile }}{{ $person->phone }}
+ diff --git a/resources/views/people/show.blade.php b/resources/views/people/show.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/routes/web.php b/routes/web.php index 810aa34..f0febfe 100644 --- a/routes/web.php +++ b/routes/web.php @@ -14,3 +14,6 @@ Route::get('/', function () { return view('welcome'); }); + +Route::get('/people', 'PeopleController@index'); +Route::get('/people/{person}', 'PeopleController@show');