line('# legacy_mappings.conf'); $this->line(''); $this->line('map $uri $new_location {'); $artworks = Artwork::whereNotNull('legacy_filename')->get(); foreach ($artworks as $artwork) { if (!in_array($artwork->legacy_filename, $oldLocations) && !in_array($artwork->legacy_filename, $newLocations)) { $oldLocations[] = $artwork->legacy_filename; $newLocations[] = $artwork->legacy_filename; $this->line(' "' . $artwork->legacy_filename . '" "/legacy-asset/?legacy_filename=' . urlencode($artwork->legacy_filename) . '";'); } } $this->line(' default $uri;'); $this->line('}'); $this->line(''); } }