/** * Composer for showing a course * @param View $view */ public function compose(View $view) { $course = $view->getData()['course']; $view->with('course_categories', \Category::getCourseCategories($course)); $view->with('images', \Image::listImagesWithCleanPath($course)); $view->with('videos', \Video::listVideosWithCleanPath($course)); $view->with('ebooks', \Ebook::listEbooksWithCleanPath($course)); $view->with('links', \Link::listLinksWithNames($course)); $view->with('created_at', \MyCarbon::format($course->created_at->diffForHumans())); $view->with('course_user', $course->user); $view->with('count_likes', \Course::countLikes($course)); $view->with('count_dislikes', \Course::countDislikes($course)); if (Auth::check()) { \JavaScript::put(['star_index' => \Course::getLikeRating($course, Auth::user())]); } }
public function testExtendedClassToString() { $d = MyCarbon::now(); $this->assertSame($d->toDateTimeString(), '' . $d); }