示例#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;
 }