Example #1
0
 public function getByPermalink($permalink)
 {
     $page = Permalink::where('permalink', $permalink)->firstOrFail();
     $type = (new ReflectionClass($post = $page->postable))->getShortName();
     return view()->exists(theme('front', $permalink)) ? view(theme('front', $permalink), compact('post')) : $this->{'get' . $type}(false, $post->slug);
 }