$items * @property-read int|null $items_count * @property-read \Illuminate\Database\Eloquent\Collection $posts * @property-read int|null $posts_count * @property-read Profile|null $profile * * @method static \Illuminate\Database\Eloquent\Builder|Collection newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Collection newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Collection query() * @method static \Illuminate\Database\Eloquent\Builder|Collection whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereDescription($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereIsNsfw($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereProfileId($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection wherePublishedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereTitle($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Collection whereVisibility($value) * * @mixin \Eloquent */ class Collection extends Model { use HasSnowflakePrimary; /** * Indicates if the IDs are auto-incrementing. * * @var bool */ public $incrementing = false; public $fillable = ['profile_id', 'published_at']; public $dates = ['published_at']; public function profile() { return $this->belongsTo(Profile::class); } public function items() { return $this->hasMany(CollectionItem::class); } public function posts() { return $this->hasManyThrough( Status::class, CollectionItem::class, 'collection_id', 'id', 'id', 'object_id' ); } public function url() { return url("/c/{$this->id}"); } }