better file password implementation

This commit is contained in:
2024-04-25 18:40:40 +10:00
parent c702253837
commit 39609edc9e
6 changed files with 19 additions and 5 deletions

View File

@@ -72,6 +72,13 @@ class MediaController extends Controller
}
$media = $media->paginate($perPage)->onEachSide(1);
// Transform the 'password' field of each item in the collection
$media->getCollection()->transform(function ($item) {
$item->password = $item->password ? 'yes' : null;
return $item;
});
return $media;
}