'boolean']; public static function findBySlug(string $slug): self { return static::where('slug', $slug)->firstOrFail(); } // Секции страницы (сводная таблица page_sections с порядком) public function pageSections(): HasMany { return $this->hasMany(PageSection::class)->orderBy('sort_order'); } // Блоки страницы через pivot — удобно для attach/detach/sync public function blocks(): BelongsToMany { return $this->belongsToMany(Block::class, 'page_sections') ->withPivot('sort_order') ->orderByPivot('sort_order'); } }