mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
lecturer lib added
This commit is contained in:
@@ -17,9 +17,16 @@ class Library extends Component
|
||||
|
||||
public function render()
|
||||
{
|
||||
$shouldBePublic = request()
|
||||
->route()
|
||||
->getName() !== 'library.lecturer';
|
||||
if (!$shouldBePublic && !auth()->user()->is_lecturer) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('livewire.frontend.library', [
|
||||
'libraries' => \App\Models\Library::query()
|
||||
->where('is_public', true)
|
||||
->where('is_public', $shouldBePublic)
|
||||
->get()
|
||||
->prepend(\App\Models\Library::make([
|
||||
'name' => 'Alle',
|
||||
|
||||
Reference in New Issue
Block a user