Files
RomhackPlaza/app/Traits/HasGallery.php

15 lines
280 B
PHP
Raw Normal View History

2026-06-10 11:04:26 +02:00
<?php
namespace App\Traits;
use App\Models\Gallery;
use Illuminate\Database\Eloquent\Relations\MorphMany;
trait HasGallery
{
public function gallery(): MorphMany
{
2026-06-16 16:21:43 +02:00
return $this->morphMany(Gallery::class, 'galleryable')->orderBy('order')->orderBy('id');
2026-06-10 11:04:26 +02:00
}
}