예제 #1
0
파일: User.php 프로젝트: Retsediv/edu
 /**
  * @param Course $course
  * @return bool
  */
 public function isAuthor(Course $course)
 {
     $authorId = $course->author()->get()->first()->id;
     if ($authorId == Auth::user()->id) {
         return true;
     }
     return false;
 }
예제 #2
0
파일: Course.php 프로젝트: Retsediv/edu
 /**
  * @param Course $course
  * @return string
  */
 public static function getAuthorFullName(Course $course)
 {
     $author = $course->author()->get()->first();
     return $author->name . ' ' . $author->last_name;
 }