Skip to content

Commit f8537d4

Browse files
committed
Update RELEASE_NOTES.md
1 parent ea8455f commit f8537d4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

RELEASE_NOTES.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ This serves two purposes:
121121
- Markdown headings are now compiled using our custom Blade-based heading renderer in https://github.com/hydephp/develop/pull/2047
122122
- The `id` attributes for heading permalinks have been moved from the anchor to the heading element in https://github.com/hydephp/develop/pull/2052
123123
- Colored Markdown blockquotes are now rendered using Blade and TailwindCSS, this change is not visible in the rendered result, but the HTML output has changed in https://github.com/hydephp/develop/pull/2056
124+
- **Improved Routes facade API with more intuitive method names** in https://github.com/hydephp/develop/pull/2179
125+
- **Breaking:** Renamed `Routes::get()` to `Routes::find()` to better indicate it may return null
126+
- **Breaking:** Renamed `Routes::getOrFail()` to `Routes::get()` to make the exception-throwing behavior the default and match Laravel conventions
127+
- This change requires code updates if you were using these methods - see upgrade guide below
124128

125129
### Deprecated
126130

@@ -536,6 +540,33 @@ Hyperlinks::isRemote($source);
536540

537541
This change was implemented in https://github.com/hydephp/develop/pull/1883. Make sure to update any instances of `FeaturedImage::isRemote()` in your codebase to ensure compatibility with HydePHP v2.0.
538542

543+
### Routes facade API changes
544+
545+
The Routes facade API has been improved to better follow Laravel naming conventions and make the API more intuitive. This change affects code that directly uses the Routes facade methods.
546+
547+
#### Changes
548+
549+
- The `Routes::get()` method has been renamed to `Routes::find()` to better indicate that it may return null if a route is not found
550+
- The `Routes::getOrFail()` method has been renamed to `Routes::get()` to make the exception-throwing behavior the default, matching Laravel conventions
551+
552+
#### Upgrade guide
553+
554+
If you have used the Routes facade in your custom code, update it as follows:
555+
556+
```php
557+
// Old code:
558+
$route = Routes::get('some-route'); // Returns null if not found
559+
$route = Routes::getOrFail('some-route'); // Throws exception if not found
560+
561+
// New code:
562+
$route = Routes::find('some-route'); // Returns null if not found
563+
$route = Routes::get('some-route'); // Throws exception if not found
564+
```
565+
566+
This change provides more intuitive method names and better type safety, with `find()` returning `?Route` and `get()` returning `Route`.
567+
568+
This change was implemented in https://github.com/hydephp/develop/pull/2179.
569+
539570
## New Asset System
540571

541572
### Abstract

0 commit comments

Comments
 (0)