Added a PeopleController.

Added a basic route to the index page of all people.
Added views and controller for this purpose.
This commit is contained in:
Lukas Halbritter
2018-09-07 22:50:36 +02:00
parent 0d44875eb3
commit cdba55315d
5 changed files with 57 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Person;
class PeopleController extends Controller
{
public function index()
{
$people = Person::orderBy('name_or_company')->get();
return view('people.index', compact('people'));
}
public function show(Person $person)
{
return view('people.show', compact('person'));
}
}