HydePHP v2.0 represents a major evolution of the framework, introducing significant improvements to the asset system, navigation API, and overall developer experience. This release modernizes the frontend tooling by replacing Laravel Mix with Vite, completely rewrites the navigation system for better flexibility, and introduces numerous performance optimizations throughout the framework.
This document will give you an overview of the changes. When you're ready to upgrade your site, take a look at the Upgrade Guide.
We've replaced Laravel Mix with Vite for a faster, more modern development experience:
- Instant Hot Module Replacement (HMR) for real-time updates during development
- Direct asset compilation into the
_mediafolder for cleaner builds - Updated build command: Use
npm run buildinstead ofnpm run prod(or--viteduring the site build) - Vite facade for seamless Blade template integration
- Optimized asset serving through the realtime compiler
- Hyde Vite plugin for enhanced integration
The new consolidated Asset API provides a more intuitive interface for handling media files:
- MediaFile instances with fluent methods like
getLink(),getLength(), andgetMimeType() - HydeFront facade for CDN links and Tailwind configuration injection
- Intelligent caching with CRC32 hashing for improved performance
- Automatic validation to prevent missing assets from going unnoticed
- Lazy-loaded metadata for optimal resource usage
The navigation system has been completely rewritten for maximum flexibility:
- YAML configuration support for defining navigation items
- Extra attributes for custom styling and behavior
- Improved Routes facade with Laravel-consistent naming conventions
- Natural priority ordering using numeric prefixes in filenames
- Enhanced sidebar management with better organization options
Documentation pages now benefit from several enhancements:
- Alpine.js-powered search with customizable implementation
- Blade-based table of contents that's 40x faster than before
- Custom heading renderer with improved permalink handling
- Colored blockquotes now using Tailwind CSS classes
- Smart natural language processing for search headings
- Dynamic source file links in Markdown documents
Numerous quality-of-life improvements for developers:
- PHP 8.4 support and Laravel 11 compatibility
- ESM module support for modern JavaScript development
- Tailwind CSS v4 with automated upgrade tools
- Enhanced data collections with syntax validation
- Improved error messages with clearer exception handling
- Interactive publish:views command on Unix systems
- Extension callbacks with
booting()andbooted()methods
π For complete step-by-step upgrade instructions, see the Upgrade Guide.
Important: PHP 8.2+ is now required. Laravel Mix has been replaced with Vite, and Tailwind CSS has been upgraded to v4.
We've upgraded from Tailwind CSS v3 to v4. Run the automated upgrade tool to migrate your custom classes:
npx @tailwindcss/upgradeReview the Tailwind v4 Upgrade Guide for detailed breaking changes.
Frontend tooling now uses ESM modules instead of CommonJS. If you have custom JavaScript, update to ESM syntax:
Before:
const module = require('module-name');
module.exports = { /* ... */ };After:
import module from 'module-name';
export default { /* ... */ };Update your navigation configuration to use the new array-based format:
Before:
'navigation' => [
'custom_items' => [
'Custom Item' => '/custom-page',
],
],After:
'navigation' => [
'custom_items' => [
['label' => 'Custom Item', 'destination' => '/custom-page'],
],
],Replace static method calls with enum values in your config/hyde.php:
Before:
'features' => [
Features::htmlPages(),
Features::markdownPosts(),
],After:
'features' => [
Feature::HtmlPages,
Feature::MarkdownPosts,
],The blog post author feature has been significantly improved:
Configuration changes:
// Before
'authors' => [
Author::create('username', 'Display Name', 'https://example.com'),
],
// After
'authors' => [
'username' => Author::create(
name: 'Display Name',
website: 'https://example.com',
bio: 'Author bio',
avatar: 'avatar.png',
socials: ['twitter' => '@username']
),
],Key changes:
- Authors are now keyed by username
Author::create()returns an array instead of aPostAuthorinstanceAuthor::get()returnsnullif not found (previously created new instance)- Usernames are automatically normalized (lowercase, underscores for spaces)
- Authors support biographies, avatars, and social media links
- A new
Hyde::authors()method provides access to all site authors - Authors can be configured via YAML
The way this system now works is that you first define authors in the config, Hyde then loads this during the booting process, and you can then access them using the get method.
All asset methods now return MediaFile instances instead of strings. This instance can be cast to a string which will automatically resolve to a relative link at that time. You can also call helper methods on it. When using Blade templates, thanks to the Stringable implementation no change will happen.
// Methods renamed for clarity
Hyde::asset('image.png'); // Previously: Hyde::mediaLink()
Asset::get('image.png'); // Previously: Asset::mediaLink()
Asset::exists('image.png'); // Previously: Asset::hasMediaFile()
HydeFront::cdnLink('app.css'); // Previously: Asset::cdnLink()Configuration changes:
- Rename
hyde.enable_cache_bustingtohyde.cache_busting - Remove references to
hyde.hydefront_versionandhyde.hydefront_cdn_url
Methods renamed to follow Laravel conventions:
// Before
$route = Routes::get('route-name'); // Returns null if not found
$route = Routes::getOrFail('route-name'); // Throws exception
// After
$route = Routes::find('route-name'); // Returns null if not found
$route = Routes::get('route-name'); // Throws exception- Class renamed from
DataCollectionstoDataCollection - Syntax validation now throws
ParseExceptionfor malformed files - Empty data files are no longer allowed
- Directory creation is no longer automatic
- The
routefunction now throwsRouteNotFoundExceptionif route not found
Methods now return HtmlString objects:
{{-- Before: Required unescaped output --}}
{!! Includes::html('partial') !!}
{{-- After: Automatic rendering --}}
{{ Includes::html('partial') }}{{ e(Includes::html('foo')) }} for user-generated content.
The documentation search page is now generated as an InMemoryPage instead of a post-build task, meaning it appears in the dashboard and route list.
Documentation sidebar configuration has been reorganized:
docs.sidebar_orderβdocs.sidebar.orderdocs.table_of_contentsβdocs.sidebar.table_of_contentsdocs.sidebar_group_labelsβdocs.sidebar.labels
- Simplified image front matter with new "caption" field
- Date prefixes in filenames for automatic publishing dates
- Rich markup data with BlogPosting Schema.org type
- Author collections accessible via
Hyde::authors() - Custom posts support in blog feed component
- Vite integration with HMR support in realtime compiler
- Smart asset compilation - app.js only compiles when needed
- Environment variable support for saving previews
- Grouped progress bars for InMemoryPage instances
- Media asset transfers via dedicated build task
- Interactive publish:views command on Unix systems
- Custom HydeSearch.js support for search customization
- Extension callbacks with
booting()andbooted()methods - Dynamic source file links in Markdown documents (for example
[Home](/_pages/index.blade.php)) - Filesystem::ensureParentDirectoryExists() helper method
- Simplified asset file locator for media source directory
- Added Vite HMR support
- Experimental Laravel Herd support
- Complete migration from Sass to Tailwind CSS
- Extracted CSS component partials
- Removed legacy hyde.css file
- 40x faster table of contents generation using Blade components
- CRC32 hashing replaces MD5 for cache busting (much faster)
- Lazy-loaded media metadata with in-memory caching
- Cached media assets in HydeKernel for instant access
- PHP: Now requires 8.2β8.4 (dropped 8.1 support)
- Laravel: Upgraded to version 11
- Tailwind CSS: Upgraded to version 4
- Symfony/Yaml: Updated to version 7
- Torchlight: Switched to forked version for compatibility
PostAuthor::getName()- use$author->namepropertyFeaturedImage::isRemote()- useHyperlinks::isRemote()DocumentationPage::getTableOfContents()- use Blade componentMarkdownService::withPermalinks()andcanEnablePermalinks()
npm run prod- replaced bynpm run build--run-devand--run-prodflags - replaced by--vite--run-prettierflag and Prettier dependency removed
hyde.hydefront_versionandhyde.hydefront_cdn_url- now handled automaticallyhyde.enable_cache_busting- renamed tohyde.cache_bustinghyde.navigation.subdirectories- renamed tohyde.navigation.subdirectory_display
hyde.cssfrom HydeFront - all styles now inapp.csstable-of-contents.css,heading-permalinks.css,blockquotes.css- styles now use Tailwind.torchlight-enabledCSS class<x-hyde::docs.search-input />and<x-hyde::docs.search-scripts />components - replaced by<x-hyde::docs.hyde-search />
- Documentation: https://hydephp.com/docs/2.x
- Upgrade Guide: https://hydephp.com/docs/2.x/upgrade-guide
- GitHub Issues: https://github.com/hydephp/hyde/issues
- Community Discord: https://discord.hydephp.com
For the complete changelog with all pull request references, see the full changelog.