Exemplo n.º 1
0
 /**
  * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
  */
 public function creator()
 {
     return $this->belongsTo(\CMS::userModel(), 'created_by');
 }
Exemplo n.º 2
0
 /**
  * @param string $filed
  *
  * @return User|null
  */
 protected function loadUserTableByField($filed)
 {
     if (array_key_exists($this->{$filed}, static::$loadedUsers)) {
         return static::$loadedUsers[$this->{$filed}];
     }
     return static::$loadedUsers[$this->{$filed}] = $this->belongsTo(\CMS::userModel(), $filed);
 }
Exemplo n.º 3
0
 /**
  * Get the user that the token belongs to.
  */
 public function user()
 {
     return $this->belongsTo(\CMS::userModel(), 'user_id');
 }