phpvms/app/Models/Traits/FilesTrait.php
2018-08-26 16:40:04 +00:00

24 lines
373 B
PHP

<?php
namespace App\Models\Traits;
use App\Models\File;
trait FilesTrait
{
/**
* Morph to type of File
*
* @return mixed
*/
public function files()
{
return $this->morphMany(
File::class,
'files', // overridden by the next two anyway
'ref_model',
'ref_model_id'
);
}
}