/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // forma de no fer API correctament // 1. No es retorna paginació $tasks = task::all(); return Response::json(['data' => $this->transformCollection($tasks)], 200); }
public function get_index() { try { $table = task::all(); return View::make('page1', array('table' => $table)); } catch (Exception $e) { return $e; } }