jeudi 26 octobre 2017

toSearchableArray() send the same 1 row 7 times to Algolia?

Maybe I've been looking at this code to extend (all day) It only retrieves one post from DB but sends it 7 times to Algolia ...

There are 7 items in the database

6 records with status = PUBLISHED

1 post with status = DRAFT

public function toSearchableArray()
      {
          $array = Post::where('status', '=', static::PUBLISHED)->toArray();
          return $array;
      }

  What am I doing wrong, pleeese help ??



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire