body_start(); // TODO:what you want you can write,inside this, // TODO:it's recommended to have a column inside it $mega_menu_items = Appointment::with(['lang_query' => function($query) use ($lang){ $query->where('lang', $lang); }])->whereIn('id',$ids)->get()->groupBy('categories_id'); if ($settings['sort_by'] === 'asc'){ $mega_menu_items->sortBy($settings['sort']); }else { $mega_menu_items ->sortByDesc($settings['sort']); } foreach ($mega_menu_items as $cat => $posts) { $output .= '
' ."\n"; $output .= '
'."\n"; if (!empty($settings['category_status'])){ $output .= '

' . $this->category($cat). '

'."\n"; } $output .= ''."\n"; $output .= '
'."\n"; $output .= '
'."\n"; } $output .= $this->body_end(); return $output; } function slug() { return 'appointment_page_slug'; } function name() { return 'appointment_page_[lang]_name'; } function enable() { return (boolean) get_static_option('appointment_module_status'); } function category($id) { $category = AppointmentCategoryLang::where(['cat_id' => $id])->first(); return $category->title ?? __('Uncategorized'); } function query_type() { return 'new_lang'; // old_lang|new_lang } function title_param() { // TODO: Implement title_param() method. return 'title'; } }