Skip to content

Depreciation warnings on production with php8.4 #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
npldevfr opened this issue Apr 26, 2025 · 0 comments
Open

Depreciation warnings on production with php8.4 #127

npldevfr opened this issue Apr 26, 2025 · 0 comments

Comments

@npldevfr
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant