/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $links = Link::all(); $lesson = Lesson::findOrFail($id); $videos = $lesson->links->filter(function ($item) { if ($item->iframe == "") { return; } return $item; }); foreach ($videos as $link) { $re = "/src=\\\"(.*?)\\\"/"; preg_match($re, $link->iframe, $matches); if ($matches) { $link->iframe = $matches[1]; $link->save(); } } return view('site.lessons.show')->with(['lesson' => $lesson, 'videos' => $videos]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $page = $this->page->getWhereSlug('links'); $links = Link::all(); return view('main.links')->with('page', $page)->with('links', $links); }
/** * Display a listing of the Link. * * @return Response */ public function index() { $links = Link::all(); return view('admin.links.index')->with('links', $links); }