File: D:/HostingSpaces/SBogers54/csbinstallatietechniek.nl/app/Base/HasHeroImagesTrait.php
<?php
namespace App\Base;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Komma\KMS\Documents\Models\Document;
trait HasHeroImagesTrait
{
/**
* Get the images through documents belonging to this model
*
* @return \Illuminate\Database\Eloquent\Relations\hasMany
*/
public function heroImages():MorphMany
{
return $this->morphMany(Document::class, 'documentable')
->where('key', '=', 'Documents-hero')
->orderBy('sort_order');
}
}