/** * Sync up the list of tags in the database * @param Course $course * @param array $tags * @internal param Course $article */ private function syncTags(Course $course, array $tags) { $course->tags()->sync($tags); }
public function preview(Course $course) { $user = $this->user; return view('course.preview', compact('course', 'user'))->with(['title' => $course->title, 'meta_description' => str_limit(strip_tags($course->description), 120, '...'), 'meta_keywords' => implode(', ', $course->tags()->lists('name')->toArray())]); }