Esempio n. 1
0
 public function index(Project $project, ProjectsComment $projectsComment, Request $request)
 {
     $this->projectsComment($projectsComment);
     if (isset($_POST['sort'])) {
         $input = \Input::all();
         $sort = $input['sort'];
         $sortBy = $input['sortBy'];
         $this->data['records'] = $project->getActiveSort($sort, $sortBy);
     } else {
         $this->data['records'] = $project->getActive();
     }
     $this->data['top_views_records'] = $project->top_views_getActive();
     $this->data['top_last_records'] = $project->top_last_getActive();
     if ($request->ajax()) {
         return response()->json(view('projects.ajaxPaginate.Index', $this->data)->render());
     }
     return view('projects.index', $this->data);
 }