/** * 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::make('facility.index')->with('facilities', $facilities); }
public function testStorePass() { echo "\n\nFACILITY CONTROLLER TEST\n\n"; $facilityName = 'TEL AVIV MEDICAL CENTRE'; $this->action('POST', 'FacilityController@store', array('name' => $facilityName)); $facility = Facility::orderBy('id', 'desc')->first(); $this->assertEquals($facilityName, $facility->name); }