Created
May 15, 2017 19:07
-
-
Save omarkdev/66eef45cdb53784a06a6c590c64d9d3b 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) { | |
if (!empty($lesson->thumb_url)) { | |
$this->seo()->addImages($lesson->thumb_url); | |
} | |
if ($lesson->track) { | |
$this->seo()->setTitle($lesson->title.' ['.$lesson->track->title.']'); | |
} else { | |
$this->seo()->setTitle($lesson->title); | |
} | |
$this->seo()->setDescription($lesson->description); | |
return $this->view('lessons::show')->with(compact('lesson')); | |
} | |
return redirect(route('lesson.index')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment