function dataAll() { return $this->table->where('page_id', '=', Request::route('id1'))->whereIn('section_id', Section::where('single', '=', 0)->lists('id'))->with('section')->get(); }
function countPosts($name) { return Post::where('page_id', '=', $this->id)->whereIn('section_id', Section::where('name', '=', $name)->lists('id'))->count(); }