Skip to content

Conversation

@drewgallagher
Copy link

…query builder

when calling firstOrFail on DB facade query builder, it throws exception

local.ERROR: Call to undefined method Illuminate\Database\Query\Builder::firstOrFail() {"exception":"[object] (BadMethodCallException(code: 0): Call to undefined method Illuminate\Database\Query\Builder::firstOrFail() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:67) [stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(4390): Illuminate\Database\Query\Builder::throwBadMethodCallException('firstOrFail') #1 /var/www/html/database/migrations/2024

function should not be in docs until readily available to use

https://stackoverflow.com/questions/79145864/call-to-undefined-method-illuminate-database-query-builderfirstorfail-lara?noredirect=1#comment139562863_79145864

…query builder

when calling firstOrFail on DB facade query builder, it throws exception

local.ERROR: Call to undefined method Illuminate\Database\Query\Builder::firstOrFail() {"exception":"[object] (BadMethodCallException(code: 0): Call to undefined method Illuminate\\Database\\Query\\Builder::firstOrFail() at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:67)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(4390): Illuminate\\Database\\Query\\Builder::throwBadMethodCallException('firstOrFail')
laravel#1 /var/www/html/database/migrations/2024

function should not be in docs until readily available to use

https://stackoverflow.com/questions/79145864/call-to-undefined-method-illuminate-database-query-builderfirstorfail-lara?noredirect=1#comment139562863_79145864
@crynobone
Copy link
Member

https://github.com/laravel/framework/blob/db76573f6a63384215679bfa7101102bbb8caecb/src/Illuminate/Database/Concerns/BuildsQueries.php#L356

The code does exists for query builder

@drewgallagher
Copy link
Author

drewgallagher commented Nov 4, 2024

@crynobone why for Laravel 11 is it not working then? Are the changes not deployed to users? Because on "laravel/framework": "^11.28" it's throwing the error.

@taylorotwell why are we closing this issue when it's still present?

Here is a video recording of the issue in my local environment https://www.loom.com/share/8d41a2cc46a64555b7e65b04a18340da?sid=040ea3db-ba59-432a-9e68-ba05c5f2c927

Others are commenting that the code is not available https://stackoverflow.com/questions/79145864/call-to-undefined-method-illuminate-database-query-builderfirstorfail-lara

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