public function makeTagArray(Model $model, string $field = 'name'): array
    {
        /** @var Collection $tags */
        $tags = $model->tags;

        return $tags->pluck($field)->all();
    }
public function makeTagArray(Model $model, string $field = 'name'): array
    {
        /** @var Collection $tags */
        $tags = $model->tags;

        return $tags->pluck($field)->all();
    }
public function makeTagArray ( Model $ model , string $ field = 'name' ) : array { /** @var Collection $tags */ $ tags = $ model -> tags ; return $ tags -> pluck ( $ field ) -> all ( ) ; }
Build a simple array of a model's tags.

@param \Illuminate\Database\Eloquent\Model $model
@param string $field

@return array
Build a simple array of a model s tags .