*/ use HasFactory; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'is_published' => 'boolean', ]; } /** * @param Builder $query * @return Builder */ #[Scope] protected function published(Builder $query): Builder { return $query->where('is_published', true)->orderBy('sort_order'); } }