steps taken to reproduce your issue- [ pass null using $model->hasTag('foo')]
Laravel version 7.12.0
PHP version 7.3.2
error = Call to a member function pluck() on null
Cviebrock\EloquentTaggable\Services\TagService::makeTagArray
vendor/cviebrock/eloquent-taggable/src/Services/TagService.php:166
Suggested change to method:
----current----
public function makeTagArray(Model $model, string $field = 'name'): array
{
/* @var Collection $tags /
$tags = $model->tags;
return $tags->pluck($field)->all();
}
----suggested----
public function makeTagArray(Model $model, string $field = 'name'): array
{
/* @var Collection $tags /
$tags = $model->tags;
steps taken to reproduce your issue- [ pass null using $model->hasTag('foo')]
Laravel version 7.12.0 PHP version 7.3.2
error = Call to a member function pluck() on null Cviebrock\EloquentTaggable\Services\TagService::makeTagArray vendor/cviebrock/eloquent-taggable/src/Services/TagService.php:166
Suggested change to method:
----current----
public function makeTagArray(Model $model, string $field = 'name'): array { /* @var Collection $tags / $tags = $model->tags;
----suggested----
public function makeTagArray(Model $model, string $field = 'name'): array { /* @var Collection $tags / $tags = $model->tags;
Thanks!!!