Open SafonovVA opened 2 years ago
9.14.0
8.1.5
1.5.2
PostgeSQL 14.3
_jsondecode(): Passing null to parameter #1 ($json) of type string is deprecated in /var/www/vendor/tcg/voyager/src/Models/MenuItem.php on line 93
This warning shows the debugbar on any page in Voyager
Get rid of the warning
Try to use null coleascing operator:
public function getParametersAttribute() { -. return json_decode($this->attributes['parameters']); }
public function getParametersAttribute() { +. return json_decode($this->attributes['parameters'] ?? ''); }
same problem
Also could be fixed with https://github.com/the-control-group/voyager/pull/5575
Laravel version
9.14.0
PHP version
8.1.5
Voyager version
1.5.2
Database
PostgeSQL 14.3
Description
_jsondecode(): Passing null to parameter #1 ($json) of type string is deprecated in /var/www/vendor/tcg/voyager/src/Models/MenuItem.php on line 93
Steps to reproduce
This warning shows the debugbar on any page in Voyager
Expected behavior
Get rid of the warning
Screenshots
Additional context
Try to use null coleascing operator:
public function getParametersAttribute() { -. return json_decode($this->attributes['parameters']); }
public function getParametersAttribute() { +. return json_decode($this->attributes['parameters'] ?? ''); }