for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ByTIC\MediaLibrary\HasMedia\StandardCollections;
use ByTIC\MediaLibrary\Collections\Collection;
use ByTIC\MediaLibrary\Media\Media;
/**
* Trait StandardCollectionsShortcodes.
*
* @method Collection getMedia(string $collectionName = 'default', $filters = []): Collection
*/
trait ImageShortcodes
{
* @return Media
public function getImage()
return $this->getMedia('images')->getDefaultMedia();
}
* @return Collection|Media[]
public function getImages()
return $this->getMedia('images');
public function getLogo()
return $this->getMedia('logos')->getDefaultMedia();
public function getLogos()
return $this->getMedia('logos');
* @return bool
public function hasLogo()
return $this->getMedia('logos')->count() > 0;
public function getCover()
return $this->getMedia('covers')->getDefaultMedia();
* @return Collection
public function getCovers()
return $this->getMedia('covers');
public function hasCover()
return $this->getMedia('covers')->count() > 0;