Skip to content

Commit 1761fc8

Browse files
committed
fix test
1 parent 96e9f69 commit 1761fc8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/Http/Controllers/Gallery/PhotoController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function star(SetPhotosStarredRequest $request): void
181181
*/
182182
public function rate(SetPhotoRatingRequest $request, Rating $rating): PhotoResource
183183
{
184-
if (!$request->configs()->getValueAsBool('ratings_enabled')) {
184+
if (!$request->configs()->getValueAsBool('rating_enabled')) {
185185
throw new ConfigurationException('photo rating feature is disabled by configuration');
186186
}
187187

app/Policies/PhotoPolicy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ public function canReadRatings(?User $user, Photo $photo): bool
269269
{
270270
$config_manager = app(ConfigManager::class);
271271
// Rating are disabled globally
272-
if (!$config_manager->getValueAsBool('ratings_enabled')) {
272+
if (!$config_manager->getValueAsBool('rating_enabled')) {
273273
return false;
274274
}
275275

276276
// Note that this will bypass the setting 'rating_show_only_when_user_rated'
277277
// It is up to the admin to decide whether anonymous users can see ratings at all.
278-
return ($user !== null) || $config_manager->getValueAsBool('ratings_public');
278+
return ($user !== null) || $config_manager->getValueAsBool('rating_public');
279279
}
280280

281281
/**

database/migrations/2025_12_27_130512_add_photo_rating_config_settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function getConfigs(): array
2020
{
2121
return [
2222
[
23-
'key' => 'ratings_enabled',
23+
'key' => 'rating_enabled',
2424
'value' => '1',
2525
'cat' => self::CAT,
2626
'type_range' => self::BOOL,

0 commit comments

Comments
 (0)