diff --git a/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php b/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php new file mode 100644 index 00000000..50cb8809 --- /dev/null +++ b/database/migrations/2023_01_19_141156_fix_bookmark_visibility.php @@ -0,0 +1,54 @@ +status_id); + if(!$status) { + $bookmark->delete(); + continue; + } + + if(!in_array($status->visibility, ['public', 'unlisted', 'private'])) { + $bookmark->delete(); + continue; + } + + if(!in_array($status->visibility, ['public', 'unlisted'])) { + if($bookmark->profile_id == $status->profile_id) { + continue; + } else { + if(!FollowerService::follows($bookmark->profile_id, $status->profile_id)) { + $bookmark->delete(); + } + } + } + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};