mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.22k stars 212 forks source link

processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|Illuminate\Database\Query\Expression|string, null given #457

Closed rezalabbafi closed 6 months ago

rezalabbafi commented 7 months ago

i have this method in my repository

protected function _builder(): Builder
    {
        $model = $this->app->make($this->model());
        $builder = $model::query();
        // SOME OTHER LINES
        return $builder;
    }

When I'm using Laravel model caching and call this

$this->_builder()->find($id)

if $id = null then there is this error

GeneaLabs\LaravelModelCaching\CacheKey::processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|Illuminate\Database\Query\Expression|string, null given, called in /var/www/html/vendor/genealabs/laravel-model-caching/src/CacheKey.php on line 429

Restingo commented 6 months ago

Duplicate of #443, PR #456 should fix both.

mikebronner commented 6 months ago

This should be fixed now, thanks for your patience!