/** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function creator() { return $this->belongsTo(\CMS::userModel(), 'created_by'); }
/** * @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); }
/** * Get the user that the token belongs to. */ public function user() { return $this->belongsTo(\CMS::userModel(), 'user_id'); }