fix(Core): fix bug is lock

This commit is contained in:
2026-05-17 00:00:13 +03:30
parent 2796ce7de7
commit c3d798689c
8 changed files with 52 additions and 30 deletions

View File

@@ -23,7 +23,7 @@ class BookController extends Controller
$books = Book::where('volum_id', $validated['volum_id'])->paginate($perPage, ['*'], 'page', $page);
$books->getCollection()->transform(function ($section) {
$section['is_locked'] = auth()->user()->isSubscriber() !== true ? true : Law::where('is_locked',$section['law_id'])->first()?->is_locked ?? false;
$section['is_locked'] = auth()->user()->isSubscriber() !== false ? false : Law::where('id', $section['law_id'])->first()?->is_locked ?? false;
unset($section['law_id']);
unset($section['volum_id']);