/** * Return the view link. * * @return string */ public function viewLink() { return app('html')->link($this->dispatch(new GetCategoryPath($this->object)), $this->object->getName(), ['target' => '_blank']); }
/** * Handle the command. * * @param BreadcrumbCollection $breadcrumbs */ public function handle(BreadcrumbCollection $breadcrumbs) { $breadcrumbs->add($this->category->getName(), $this->dispatch(new GetCategoryPath($this->category))); }
/** * Find many posts by category. * * @param CategoryInterface $category * @param null $limit * @return EntryCollection */ public function findManyByCategory(CategoryInterface $category, $limit = null) { return $this->model->live()->where('category_id', $category->getId())->paginate($limit); }
/** * Handle the command. * * @param Repository $config * @return string */ public function handle(Repository $config) { return '/' . $config->get('anomaly.module.posts::paths.module') . '/' . $config->get('anomaly.module.posts::paths.category') . '/' . $this->category->getSlug(); }
public function handle(SettingRepositoryInterface $settings) { return $settings->get('anomaly.module.posts::module_segment', 'posts') . '/' . $settings->get('anomaly.module.posts::category_segment', 'category') . '/' . $this->category->getSlug(); }
/** * Find many posts by category. * * @param CategoryInterface $category * @param null $limit * @return EntryCollection */ public function findManyByCategory(CategoryInterface $category, $limit = null) { return $this->model->orderBy('created_at', 'DESC')->where('category_id', $category->getId())->paginate($limit); }
/** * Handle the command. * * @param ViewTemplate $template */ public function handle(ViewTemplate $template) { $template->set('meta_title', $this->category->getName()); }
/** * Delete a category. * * @param CategoryInterface|EntryModel $category * @return bool */ public function delete(CategoryInterface $category) { return $category->delete(); }