You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,10 @@ This serves two purposes:
121
121
- Markdown headings are now compiled using our custom Blade-based heading renderer in https://github.com/hydephp/develop/pull/2047
122
122
- The `id` attributes for heading permalinks have been moved from the anchor to the heading element in https://github.com/hydephp/develop/pull/2052
123
123
- 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
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.
538
542
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.
0 commit comments