Skip to content
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

[11.x] Import Model class for Renderer\Exception #51778

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

seriquynh
Copy link
Contributor

In Renderer\Exception::applicationRouteParametersContext() method, it has a check "$value instanceof Model" but Model class is not imported. So, I just import Model class for Renderer\Exception.

    /**
     * Get the application's route parameters context.
     *
     * @return array<string, mixed>|null
     */
    public function applicationRouteParametersContext()
    {
        $parameters = $this->request()->route()?->parameters();

        return $parameters ? json_encode(array_map(
            fn ($value) => $value instanceof Model ? $value->withoutRelations() : $value,
            $parameters
        ), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) : null;
    }

Verified

This commit was signed with the committer’s verified signature.
IvanGoncharov Ivan Goncharov
@taylorotwell taylorotwell merged commit 6d13661 into laravel:11.x Jun 12, 2024
22 of 30 checks passed
@seriquynh seriquynh deleted the add-missing-import branch June 13, 2024 01:04
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

Successfully merging this pull request may close these issues.

None yet

2 participants