Beispiel #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //List all facilities
     $facilities = Facility::orderBy('name', 'asc')->get();
     //Load the view and pass the facilities
     return view('facility.index', compact('facilities'));
 }
 public function testStorePass()
 {
     echo "\n\nFACILITY CONTROLLER TEST\n\n";
     $this->withoutMiddleware();
     $facilityName = 'TEL AVIV MEDICAL CENTRE';
     $this->call('POST', '/facility', ['name' => $facilityName]);
     $facility = Facility::orderBy('id', 'desc')->first();
     $this->assertEquals($facilityName, $facility->name);
     $this->assertRedirectedToRoute('facility.index');
 }