*/ use BumpsContentVersion, HasFactory, HasRevisions, HasTranslations; /** * The title is the name of that talk, given once in one language. * Translating it would invent a talk that never happened — only the * summary written about it afterwards is translated. * * @var array */ public array $translatable = ['summary']; protected function casts(): array { return [ 'held_at' => 'date', 'is_public' => 'boolean', ]; } /** * @return BelongsTo */ public function member(): BelongsTo { return $this->belongsTo(Member::class); } /** * @return BelongsTo */ public function project(): BelongsTo { return $this->belongsTo(Project::class); } /** * @param Builder<$this> $query * @return Builder<$this> */ public function scopePublic(Builder $query): Builder { return $query->where('is_public', true); } /** * @param Builder<$this> $query * @return Builder<$this> */ public function scopeRecentFirst(Builder $query): Builder { return $query->orderByRaw('held_at is null')->orderByDesc('held_at'); } }