Skip to content

Instantly share code, notes, and snippets.

@omarkdev
Created May 15, 2017 19:07
Show Gist options
  • Save omarkdev/66eef45cdb53784a06a6c590c64d9d3b to your computer and use it in GitHub Desktop.
Save omarkdev/66eef45cdb53784a06a6c590c64d9d3b to your computer and use it in GitHub Desktop.
<?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