@php $args = [ '@limit' => $data->post_number ? $data->post_number : 5, '@sort' => $data->sorttype ? $data->sorttype : 1, ]; $title = null; if ($data->dynamic_id && ($dynamic = $helper->getDynamic(['id' => $data->dynamic_id]))) { $args['dynamic_id'] = $data->dynamic_id; $title = $dynamic->name; } if ($data->category_id && ($category = $helper->getPostCategory(['id' => $data->category_id]))) { $args['@category'] = $data->category_id; if (!$title) { $title = $category->name; } } if ($data->content_type && $data->content_type != 'all') { $args['content_type'] = $data->content_type; } if ($data->title) { $title = $data->title; } $args['trashed_status'] = 0; @endphp @if (count($posts = $helper->getPosts($args)))
@endif