laravel-model-settings
laravel-model-settings copied to clipboard
Depreciation warnings on production with php8.4
Describe the bug Hi i'm facing to these logs in production :
[2025-04-26 14:44:14] production.WARNING: Glorand\Model\Settings\Managers\AbstractSettingsManager::get(): Implicitly marking parameter $path as nullable is deprecated, the explicit nullable type must be used instead in /home/forge/myproject/vendor/glorand/laravel-model-settings/src/Managers/AbstractSettingsManager.php on line 125
[2025-04-26 14:44:14] production.WARNING: Glorand\Model\Settings\Managers\AbstractSettingsManager::getMultiple(): Implicitly marking parameter $paths as nullable is deprecated, the explicit nullable type must be used instead in /home/forge/myproject/vendor/glorand/laravel-model-settings/src/Managers/AbstractSettingsManager.php on line 135
[2025-04-26 14:44:14] production.WARNING: Glorand\Model\Settings\Managers\AbstractSettingsManager::delete(): Implicitly marking parameter $path as nullable is deprecated, the explicit nullable type must be used instead in /home/forge/myproject/vendor/glorand/laravel-model-settings/src/Managers/AbstractSettingsManager.php on line 181
[2025-04-26 14:44:14] production.WARNING: Glorand\Model\Settings\Contracts\SettingsManagerContract::get(): Implicitly marking parameter $path as nullable is deprecated, the explicit nullable type must be used instead in /home/forge/myproject/vendor/glorand/laravel-model-settings/src/Contracts/SettingsManagerContract.php on line 26
[2025-04-26 14:44:14] production.WARNING: Glorand\Model\Settings\Contracts\SettingsManagerContract::delete(): Implicitly marking parameter $path as nullable is deprecated, the explicit nullable type must be used instead in /home/forge/myproject/vendor/glorand/laravel-model-settings/src/Contracts/SettingsManagerContract.php on line 58
To Reproduce Steps to reproduce the behavior: "php": "^8.4", "glorand/laravel-model-settings": "^8.0.1" "laravel/framework": "^v12.6.0",
This is happening when i call like this :
class UserResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*
* @throws ModelSettingsException
*/
public function toArray(Request $request): array
{
return [
'name' => $this->name,
'avatar' => $this->avatar,
'email' => $this->email,
'isVerified' => $this->hasVerifiedEmail(),
'createdAt' => $this->created_at,
'settings' => $this->settings()->all(), // here
'setup' => (bool) $this->setup,
];
}
}
Additional context In my database by default the settings field is set as null