We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
PHP throws exception when refreshing model:
class_parents(): object or string expected at /var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/helpers.php:92) [stacktrace] #0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError() #1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/helpers.php(92): class_parents() #2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1184): class_uses_recursive() #3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/Traits/EnumeratesValues.php(669): Illuminate\\Database\\Eloquent\\Model->Illuminate\\Database\\Eloquent\\{closure}() #4 [internal function]: Illuminate\\Support\\Collection->Illuminate\\Support\\Traits\\{closure}() #5 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/Arr.php(647): array_filter() #6 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/Collection.php(352): Illuminate\\Support\\Arr::where() #7 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/Traits/EnumeratesValues.php(671): Illuminate\\Support\\Collection->filter() #8 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1185): Illuminate\\Support\\Collection->reject() #9 ... Illuminate\\Database\\Eloquent\\Model->refresh() ...
$model = Model::find(1)
$model->refresh()
I think the problem is in Model.php refresh function:
Model.php
$this->load(collect($this->relations)->reject(function ($relation) { return $relation instanceof Pivot || in_array(AsPivot::class, class_uses_recursive($relation), true); })->keys()->all());
The text was updated successfully, but these errors were encountered:
Can confirm this is happening to me too.
PHP 7.4 Laravel 7.7.0 Mysql 8
Reverted back to 7.6 and it is not happening
Sorry, something went wrong.
Thanks for reporting. This was due to #32420
We're looking into a fix atm.
Releasing patch now.
No branches or pull requests
Description:
PHP throws exception when refreshing model:
Steps To Reproduce:
$model = Model::find(1)
$model->refresh()
I think the problem is in
Model.php
refresh function:The text was updated successfully, but these errors were encountered: