private function checkPlaylistsForReindex() { // check for media items which which should be reindexed because their accessibiliy has changed $playlistsToReindex = Playlist::upToDateInIndex()->where(function ($q) { $q->where(function ($q) { $q->accessibleToPublic()->where("in_index", false); })->orWhere(function ($q) { $q->notAccessibleToPublic()->where("in_index", true); }); })->get(); foreach ($playlistsToReindex as $a) { // touching will increment the version number $a->touch(); $this->info("Playlist with id " . $a->id . " queued for reindex."); } }