Skip to content

[13.x] Fix broken method calls in code examples - #11385

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
GabeSilvaDev:fix/nonexistent-methods-in-examples
Sep 29, 2026
Merged

taylorotwell merged 1 commit into
laravel:13.xfrom
GabeSilvaDev:fix/nonexistent-methods-in-examples

Conversation

@GabeSilvaDev

Copy link
Copy Markdown
Contributor

A few examples in the documentation still use methods incorrectly or call methods that don't exist in Laravel 13.x.

In eloquent-resources.md, toUserResource() is used even though the example earlier on the same page uses toResource(). In strings.md, Str::is('is')->wrap(...) calls wrap() on the result of Str::is() instead of using Str::of(). The mocking.md example uses mins(), which isn't a method on the date object returned by now(); minus() is the intended call.

There are two similar issues in the other examples. The database.md example passes the user ID directly to DB::selectResultSets(), but the bindings argument needs to be an array. In processes.md, $pool->running()->each->id() returns the InvokedProcess instances rather than their IDs, so the example should use map->id().

I checked the examples against Laravel 13.x and updated each one to use the corresponding API correctly.

Copilot AI balanced review requested due to automatic review settings September 29, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@taylorotwell
taylorotwell merged commit 0f96654 into laravel:13.x Sep 29, 2026
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.

3 participants