/** * Category by section * * @param $section * * @return mixed|static */ public function findBySection($section) { return $this->category->where('section', $section)->first(); }
?> @foreach(config('post_type') as $key => $post_type) <li class="icon-wrap @if($post_type_active==$key) active @endif "> <a class="post_type {{$key}}" data-post-type="{{$key}}" href="javascript:;"> {{$post_type}}</a> </li> @endforeach </ul> <?php $tagService = app('App\\Nrna\\Services\\TagService'); $tags = $tagService->getList(); $sectionService = app('App\\Nrna\\Services\\SectionService'); $sections = $sectionService->all(); $categories = \App\Nrna\Models\Category::where('depth', '!=', '0')->lists('title', 'id')->toArray(); $postService = app('App\\Nrna\\Services\\PostService'); $posts = $postService->getAllPosts()->lists('title', 'id')->toArray(); $show_text_type = true; if (isset($post)) { $show_text_type = false; } $post_categories = []; if (request()->has('sub_category1')) { $post_categories[] = request()->get('sub_category1'); } if (request()->has('sub_category')) { $post_categories[] = request()->get('sub_category'); } if (isset($post)) { $post_categories = $post->categories->lists('id')->toArray();