belongsTo(Album::class); } public function thumbnailUrl($thumbnailName = null) { /** @var Album $album */ $album = $this->album; return $album->getAlbumSource()->getUrlToPhoto($album, $this, $thumbnailName); } public function url() { return route('viewPhoto', [ 'albumUrlAlias' => $this->album->url_alias, 'photoFilename' => $this->storage_file_name ]); } }