CollectionItem.php 493 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\HasSnowflakePrimary;
  5. class CollectionItem extends Model
  6. {
  7. use HasSnowflakePrimary;
  8. public $fillable = [
  9. 'collection_id',
  10. 'object_type',
  11. 'object_id',
  12. 'order'
  13. ];
  14. /**
  15. * Indicates if the IDs are auto-incrementing.
  16. *
  17. * @var bool
  18. */
  19. public $incrementing = false;
  20. public function collection()
  21. {
  22. return $this->belongsTo(Collection::class);
  23. }
  24. }