Skip to content

[9.x] Handle undefined array key error - #42606

Merged
taylorotwell merged 2 commits into
laravel:9.xfrom
ksassnowski:9.x
Jun 1, 2022
Merged

[9.x] Handle undefined array key error#42606
taylorotwell merged 2 commits into
laravel:9.xfrom
ksassnowski:9.x

Conversation

@ksassnowski

Copy link
Copy Markdown
Contributor

Fixes #42605

Oh boy, the gift that keeps on giving. Looks like there's yet another edge case.

Summary

This PR fixes a regression when trying passing a model to the route helper for a route without route parameters.

$model = new User(['id' => 1]);

Route::get('/foo')->name('foo');

route('foo', $model); // Used to return `/foo?1`, now throws an exception

While I think this behavior is pretty weird, I guess it shouldn't break between minor versions.

@driesvints

Copy link
Copy Markdown
Member

At least we're adding tests for all of this 👍

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.

v9.15 has breaking change in route() helper: Unidentified array key 0

3 participants