Skip to content

Laravel 10 compatibility#7

Merged
vroomfondle merged 5 commits into
thybag:masterfrom
vroomfondle:laravel-10
May 31, 2023
Merged

Laravel 10 compatibility#7
vroomfondle merged 5 commits into
thybag:masterfrom
vroomfondle:laravel-10

Conversation

@vroomfondle
Copy link
Copy Markdown
Collaborator

Laravel is calling getDates() and that's causing the following error because the $dates attribute has been removed in Laravel 10:

TypeError : in_array(): Argument #2 ($haystack) must be of type array, null given
 /var/www/api/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:1089
 /var/www/api/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:961
 /var/www/api/vendor/thybag/pseudo-model/src/Models/PseudoModel.php:311
 /var/www/api/tests/Api/v2/Integration/Mappers/SecurityMapperTest.php:95
 /var/www/api/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:174
 

The Laravel 10 implementation of getDates() just returns the created/updated timestamps or an empty array. I've made PseudoModel just return the empty array.

@vroomfondle vroomfondle merged commit b7af3d6 into thybag:master May 31, 2023
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.

2 participants