Created
May 15, 2017 19:08
-
-
Save omarkdev/9d15ed0209f59c3314b8030782727186 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function show($slug) | |
{ | |
$lesson = $this->repository->findBySlug($slug); | |
if ($lesson) { | |
$this->addThumbToImages($lesson->thumb_url); | |
$trackTitle = ! $lesson->track ? '' : '['.$lesson->track->title.']'; | |
$this->seo()->setTitle($lesson->title . $trackTitle); | |
$this->seo()->setDescription($lesson->description); | |
return $this->view('lessons::show')->with(compact('lesson')); | |
} | |
return redirect(route('lesson.index')); | |
} | |
protected function addThumbToImages($thumbURL) | |
{ | |
if (empty($thumbURL)) { | |
return false; | |
} | |
return $this->seo()->addImages($thumbURL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment