Update Submissions and add fields
This commit is contained in:
14
app/Traits/HasGallery.php
Normal file
14
app/Traits/HasGallery.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Models\Gallery;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
trait HasGallery
|
||||
{
|
||||
public function gallery(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Gallery::class, 'galleryable')->orderBy('id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user