<?php

namespace App\Transformers\Outbound;

trait HasSuggestFields
{

    protected function getSuggestFields()
    {
        return array_replace_recursive(parent::getSuggestFields(), [

            'suggest_autocomplete_boosted' => [
                'filter' => function ($item) {
                    return $item->isBoosted() && isset($item->title);
                },
            ],

            'suggest_autocomplete_all' => [
                'filter' => function ($item) {
                    return isset($item->title);
                },
            ],

        ]);
    }

}

<?php

namespace App\Transformers\Outbound;

trait HasSuggestFields
{

    protected function getSuggestFields()
    {
        return array_replace_recursive(parent::getSearchFields(), [

            'suggest_autocomplete_boosted' => [
                'filter' => function ($item) {
                    return $item->isBoosted() && isset($item->title);
                },
            ],

            'suggest_autocomplete_all' => [
                'filter' => function ($item) {
                    return isset($item->title);
                },
            ],

        ]);
    }

}

--- 
+++ 
@@ -7,7 +7,7 @@
 
     protected function getSuggestFields()
     {
-        return array_replace_recursive(parent::getSearchFields(), [
+        return array_replace_recursive(parent::getSuggestFields(), [
 
             'suggest_autocomplete_boosted' => [
                 'filter' => function ($item) {
Fix function reference in `getSuggestFields`
