/**
  * Resolve the post.
  *
  * @return PostInterface|null
  */
 public function resolve()
 {
     $permalink = explode('/', $this->config->get('anomaly.module.posts::paths.route'));
     return $this->posts->findBySlug($this->request->segment(array_search('{post}', $permalink) + 2));
 }
Exemple #2
0
 /**
  * Resolve the post.
  *
  * @return PostInterface|null
  */
 public function resolve()
 {
     $permalink = $this->settings->value('anomaly.module.posts::permalink_structure', ['year', 'month', 'day', 'post']);
     return $this->posts->findBySlug($this->request->segment(array_search('post', $permalink) + 2));
 }
 /**
  * Resolve the post.
  *
  * @return PostInterface|null
  */
 public function resolve()
 {
     $base = $this->settings->get('anomaly.module.posts::module_base', 'posts');
     $structure = $base . '/' . $this->settings->get('anomaly.module.posts::permalink_structure', '{year}/{month}/{day}/{post}');
     return $this->posts->findBySlug($this->request->segment(array_search('{post}', explode('/', $structure)) + 1));
 }