We’re absolutely open to PRs that work for all the different conditions, or reducing complexity
get_the_title() wouldn’t work everywhere. That complexity is there for a reason to be compatible with all the different scenarios. Wouldn’t it be more complex to introduce a bunch of new view composers that might not be used?
The @hasSection('sidebar') conditional in app.blade.php is actually good practice
It only renders the <aside> wrapper if sidebar content exists. Without it, you’d have empty <aside class="sidebar"></aside> elements on pages without sidebars, which is poor HTML semantics and can cause CSS layout issues