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 ??



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iB30G5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire