public function cart($slug, Project $project, Request $request) { $this->data['records'] = $project->getBySlug($slug); $id_data = $project->getBySlug($slug); $id_projects_comment = $id_data->id; //Ід проекта $this->data['projectsComments'] = $project->projectsComments($id_projects_comment); $this->data['projectsCommentsCount'] = $project->projectsCommentsCount($id_projects_comment); \DB::table('projects')->WHERE('id', '=', $id_projects_comment)->increment('count_views_projects'); // рахуємо кулькість переглядів проектів if ($request->ajax()) { return response()->json(view('projects.ajaxPaginate.Cart', $this->data)->render()); } return view('projects.cart', $this->data); }