'boolean', 'published_at' => 'datetime', ]; // ── Scopes ─────────────────────────────────────────────────────────── public function scopePublished($query) { return $query->where('is_published', true) ->where(fn ($q) => $q->whereNull('published_at')->orWhere('published_at', '<=', now())); } // ── Accessors ──────────────────────────────────────────────────────── public function getUrlAttribute(): string { return url('/pages/' . $this->slug); } public function getCanonicalUrlAttribute(): string { return $this->url; } }