/** * Display a listing of the resource. * * @return Response */ public function index() { //List all test categories $testcategory = TestCategory::orderBy('name', 'ASC')->get(); //Load the view and pass the test categories return view('testcategory.index')->with('testcategory', $testcategory); }
/** * Tests the update function in the TestCategoryController * @param void * @return void */ public function testDelete() { $this->withoutMiddleware(); $this->call('POST', '/testcategory', $this->testCategoryData); $testCategorystored = TestCategory::orderBy('id', 'desc')->first(); $this->call('DELETE', '/testcategory/' . $testCategorystored->id . '/delete', $this->testCategoryData); $testCategoriesDeleted = TestCategory::withTrashed()->find($testCategorystored->id); $this->assertNotNull($testCategoriesDeleted->deleted_at); }