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

Declaration of Litepie\Repository\Eloquent\BaseRepository::count() should be compatible with Prettus\Repository\Eloquent\BaseRepository::count(array $where = Array, $columns = Array) #351

Open
ZeroSum000 opened this issue May 2, 2021 · 1 comment

Comments

@ZeroSum000
Copy link

ZeroSum000 commented May 2, 2021

After sudo php artisan lavalite:install and php artisan key:generate

I am receiving the error:

Declaration of Litepie\Repository\Eloquent\BaseRepository::count() should be compatible with Prettus\Repository\Eloquent\BaseRepository::count(array $where = Array, $columns = '*')

I have tried the previous recommendation of " i solved it by changing the below mentioned code within the Prettus/Eloquent/BaseRepository.php file making the BaseRepository::count method compatible with the one of Prettus, by changing its signature like this: Line 348 - public function count(array $where = [], $columns = ['id']) .

But the error is now displaying "Declaration of Litepie\Repository\Eloquent\BaseRepository::count() should be compatible with Prettus\Repository\Eloquent\BaseRepository::count(array $where = Array, $columns = Array)" and I am at a loss of what to do now.

This is a fresh base core installation with no modifications at all.

@raffaellotreeline
Copy link

I fixed this in BaseRepository.php by modifying

public function limit($value)
to
public function limit($value, $columns = ['*'])

and its internal call
$this->model = $this->model->limit($value);
to
$this->model = $this->model->limit($value, $columns);

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

3 participants
@ZeroSum000 @raffaellotreeline and others