Implement creator studio and upload updates
This commit is contained in:
@@ -179,15 +179,8 @@ class ImportLegacyArtworks extends Command
|
||||
$art = null;
|
||||
|
||||
DB::connection()->transaction(function () use (&$art, $data, $legacyId, $legacyConn, $connectedTable) {
|
||||
// create artwork (guard against unique slug collisions)
|
||||
$baseSlug = $data['slug'];
|
||||
$attempt = 0;
|
||||
$slug = $baseSlug;
|
||||
while (Artwork::where('slug', $slug)->exists()) {
|
||||
$attempt++;
|
||||
$slug = $baseSlug . '-' . $attempt;
|
||||
}
|
||||
$data['slug'] = $slug;
|
||||
// Preserve the imported slug verbatim. Public artwork URLs include the artwork id.
|
||||
$data['slug'] = Str::limit((string) ($data['slug'] ?: 'artwork'), 160, '');
|
||||
|
||||
// Preserve legacy primary ID if available and safe to do so.
|
||||
if (! empty($legacyId) && is_numeric($legacyId) && (int) $legacyId > 0) {
|
||||
|
||||
Reference in New Issue
Block a user