country = request()->route('country'); } public function sort($column) { if ($this->sortBy === $column) { $this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc'; } else { $this->sortBy = $column; $this->sortDirection = 'asc'; } } public function with(): array { return [ 'lecturers' => Lecturer::with(['createdBy']) ->when($this->search, fn($query) => $query->where('name', 'ilike', '%'.$this->search.'%') ->orWhere('description', 'ilike', '%'.$this->search.'%') ->orWhere('subtitle', 'ilike', '%'.$this->search.'%'), ) ->orderBy($this->sortBy, $this->sortDirection) ->paginate(15), ]; } }; ?>
{{ __('Dozenten') }}
@auth {{ __('Dozenten anlegen') }} @endauth
{{ __('Name') }} {{ __('Untertitel') }} {{ __('Kurse') }} {{ __('Links') }} {{ __('Aktionen') }} @foreach ($lecturers as $lecturer)
{{ $lecturer->name }}
@if($lecturer->active) {{ __('Aktiv') }} @else {{ __('Inaktiv') }} @endif
@if($lecturer->subtitle)
{{ Str::limit($lecturer->subtitle, 50) }}
@endif
{{ $lecturer->courses()->count() }} {{ __('Kurse') }}
@if($lecturer->website) @endif @if($lecturer->twitter_username) @endif @if($lecturer->nostr) @endif
{{ __('Bearbeiten') }}
@endforeach