Skip to content
New issue

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

count(): Parameter must be an array or an object that implements Countable #8

Closed
vovarpd opened this issue May 24, 2021 · 1 comment

Comments

@vovarpd
Copy link

vovarpd commented May 24, 2021

Hi.

I'm trying to make a bulk archive but got the error.
it looks like a compatibility issue with PHP7.4.

Example code:

Offer::where('published_at','<',$this->archive_until->toDateString())->archive();

added Archivable trait to the Offer model.

count(): Parameter must be an array or an object that implements Countable

  at vendor/joelbutcher/laravel-archivable/src/Scopes/ArchivableScope.php:53
     49▕      * @return string
     50▕      */
     51▕     protected function getArchivedAtColumn(Builder $builder)
     52▕     {
  ➜  53▕         if (count($builder->getQuery()->joins) > 0) {
     54▕             return $builder->getModel()->getQualifiedArchivedAtColumn();
     55▕         }
     56▕
     57▕         return $builder->getModel()->getArchivedAtColumn();

PHP 7.4.18
Laravel 8.42.1

Could you help? Thanks.

@vovarpd
Copy link
Author

vovarpd commented May 24, 2021

I think it's similar to this issue
laravel/framework#22843

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

No branches or pull requests

2 participants