File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to ` robtrehy/laravel-user-preferences ` will be documented in this file.
44
5+ ## 4.1.1 - 2025-11-09
6+ - Fix: Avoid deprecation warning in PHP 8.1+ when preferences column is null (#20 )
7+
58## 4.1.0 - 2025-11-09
69- Added methods for working with preferences for any user instance or ID:
710 - ` getForUser() `
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ function () use ($userId) {
7878 if ($ data ->isEmpty ()) {
7979 self ::$ preferencesCache [$ userId ] = (object ) config ('user-preferences.defaults ' );
8080 } else {
81- $ preferences = json_decode ($ data [0 ]->{config ('user-preferences.database.column ' )});
81+ $ preferences = json_decode ($ data [0 ]->{config ('user-preferences.database.column ' )} ?? ' {} ' );
8282 if (json_last_error () !== JSON_ERROR_NONE ) {
8383 self ::$ preferencesCache [$ userId ] = (object ) config ('user-preferences.defaults ' );
8484 } else {
You can’t perform that action at this time.
0 commit comments