diff --git a/app/Http/Livewire/Frontend/SearchBookCase.php b/app/Http/Livewire/BookCase/BookCaseTable.php similarity index 72% rename from app/Http/Livewire/Frontend/SearchBookCase.php rename to app/Http/Livewire/BookCase/BookCaseTable.php index ee90e29c..b1ef0e5e 100644 --- a/app/Http/Livewire/Frontend/SearchBookCase.php +++ b/app/Http/Livewire/BookCase/BookCaseTable.php @@ -1,18 +1,18 @@ BookCase::get(), 'countries' => Country::query() ->select(['code', 'name']) diff --git a/app/Http/Livewire/Frontend/CommentBookCase.php b/app/Http/Livewire/BookCase/CommentBookCase.php similarity index 79% rename from app/Http/Livewire/Frontend/CommentBookCase.php rename to app/Http/Livewire/BookCase/CommentBookCase.php index f56341f3..b742888b 100644 --- a/app/Http/Livewire/Frontend/CommentBookCase.php +++ b/app/Http/Livewire/BookCase/CommentBookCase.php @@ -1,6 +1,6 @@ addMedia($this->photo) ->toMediaCollection('images'); - return to_route('comment.bookcase', ['bookCase' => $this->bookCase->id]); + return to_route('bookCases.comment.bookcase', ['bookCase' => $this->bookCase->id]); } protected function url_to_absolute($url) diff --git a/app/Http/Livewire/Frontend/Header.php b/app/Http/Livewire/Frontend/Header.php index f45ec561..90b2f2b3 100644 --- a/app/Http/Livewire/Frontend/Header.php +++ b/app/Http/Livewire/Frontend/Header.php @@ -9,7 +9,7 @@ use Livewire\Component; class Header extends Component { - public Country $country; + public ?Country $country = null; public $currentRouteName; public string $c = 'de'; public bool $withGlobe = true; @@ -23,6 +23,11 @@ class Header extends Component public function mount() { + if (!$this->country) { + $this->country = Country::query() + ->where('code', $this->c) + ->first(); + } $this->currentRouteName = Route::currentRouteName(); $this->c = $this->country->code; } diff --git a/app/Http/Livewire/Frontend/SearchLecturer.php b/app/Http/Livewire/Frontend/SearchLecturer.php deleted file mode 100644 index 4d4b3b1a..00000000 --- a/app/Http/Livewire/Frontend/SearchLecturer.php +++ /dev/null @@ -1,16 +0,0 @@ -route() - ->getName() !== 'library.lecturer'; + ->getName() !== 'library.table.lecturer'; if (!$shouldBePublic && !auth()->user()->is_lecturer) { abort(403); } @@ -39,7 +39,7 @@ class Library extends Component ]); } - return view('livewire.frontend.library', [ + return view('livewire.library.library-table', [ 'libraries' => $tabs, ]); } diff --git a/app/Http/Livewire/Frontend/SearchByTagInLibrary.php b/app/Http/Livewire/Library/SearchByTagComponent.php similarity index 79% rename from app/Http/Livewire/Frontend/SearchByTagInLibrary.php rename to app/Http/Livewire/Library/SearchByTagComponent.php index 9712baa6..6fcb55c5 100644 --- a/app/Http/Livewire/Frontend/SearchByTagInLibrary.php +++ b/app/Http/Livewire/Library/SearchByTagComponent.php @@ -1,11 +1,11 @@ route() - ->getName() !== 'library.lecturer'; + ->getName() !== 'library.table.lecturer'; - return view('livewire.frontend.search-by-tag-in-library', [ + return view('livewire.library.search-by-tag-component', [ 'tags' => Tag::query() ->with([ 'libraryItems.libraries', diff --git a/app/Http/Livewire/Frontend/SearchCity.php b/app/Http/Livewire/School/CityTable.php similarity index 50% rename from app/Http/Livewire/Frontend/SearchCity.php rename to app/Http/Livewire/School/CityTable.php index 6a17f5db..96eab351 100644 --- a/app/Http/Livewire/Frontend/SearchCity.php +++ b/app/Http/Livewire/School/CityTable.php @@ -1,16 +1,16 @@ Tag::query() ->where('type', 'course') ->with([ diff --git a/app/Http/Livewire/School/VenueTable.php b/app/Http/Livewire/School/VenueTable.php new file mode 100644 index 00000000..c584fb01 --- /dev/null +++ b/app/Http/Livewire/School/VenueTable.php @@ -0,0 +1,16 @@ +find($id); $query = City::radius($city->latitude, $city->longitude, 100) ->where('id', '!=', $id); - return to_route('search.event', [ + return to_route('school.table.event', [ '#table', 'country' => $this->country, 'table' => [ @@ -94,7 +94,7 @@ class CityTable extends DataTableComponent $city = City::query() ->find($id); $query = BookCase::radius($city->latitude, $city->longitude, 5); - return to_route('search.bookcases', [ + return to_route('bookCases.table.bookcases', [ '#table', 'country' => $this->country, 'table' => [ diff --git a/app/Http/Livewire/Tables/CourseTable.php b/app/Http/Livewire/Tables/CourseTable.php index cdb1f6b9..0f7eb452 100644 --- a/app/Http/Livewire/Tables/CourseTable.php +++ b/app/Http/Livewire/Tables/CourseTable.php @@ -94,7 +94,7 @@ class CourseTable extends DataTableComponent public function courseSearch($id) { - return to_route('search.event', [ + return to_route('school.table.event', [ '#table', 'country' => $this->country, 'table' => [ diff --git a/app/Http/Livewire/Tables/LecturerTable.php b/app/Http/Livewire/Tables/LecturerTable.php index 14375230..91bbae33 100644 --- a/app/Http/Livewire/Tables/LecturerTable.php +++ b/app/Http/Livewire/Tables/LecturerTable.php @@ -81,7 +81,7 @@ class LecturerTable extends DataTableComponent { $lecturer = Lecturer::query()->find($id); - return to_route('search.event', [ + return to_route('school.table.event', [ '#table', 'country' => $this->country, 'table' => [ diff --git a/app/Http/Livewire/Tables/LibraryItemTable.php b/app/Http/Livewire/Tables/LibraryItemTable.php index 7a3b464d..208702f9 100644 --- a/app/Http/Livewire/Tables/LibraryItemTable.php +++ b/app/Http/Livewire/Tables/LibraryItemTable.php @@ -145,7 +145,7 @@ class LibraryItemTable extends DataTableComponent { $shouldBePublic = request() ->route() - ->getName() !== 'library.lecturer'; + ->getName() !== 'library.table.lecturer'; return LibraryItem::query() ->whereHas('libraries', fn($query) => $query->where('libraries.is_public', $shouldBePublic)) diff --git a/app/Http/Livewire/Tables/VenueTable.php b/app/Http/Livewire/Tables/VenueTable.php index e63e27ff..98da1ee5 100644 --- a/app/Http/Livewire/Tables/VenueTable.php +++ b/app/Http/Livewire/Tables/VenueTable.php @@ -75,7 +75,7 @@ class VenueTable extends DataTableComponent { $venue = Venue::query()->find($id); - return to_route('search.event', [ + return to_route('school.table.event', [ '#table', 'country' => $this->country, 'table' => [ diff --git a/app/Models/BookCase.php b/app/Models/BookCase.php index 7919a2f1..ab792f8b 100644 --- a/app/Models/BookCase.php +++ b/app/Models/BookCase.php @@ -74,6 +74,6 @@ class BookCase extends Model implements HasMedia */ public function commentUrl(): string { - return url()->route('comment.bookcase', ['bookCase' => $this->id]); + return url()->route('bookCases.comment.bookcase', ['bookCase' => $this->id]); } } diff --git a/resources/views/columns/book_cases/oranged-pilled.blade.php b/resources/views/columns/book_cases/oranged-pilled.blade.php index 831e7eb9..f09bbcc9 100644 --- a/resources/views/columns/book_cases/oranged-pilled.blade.php +++ b/resources/views/columns/book_cases/oranged-pilled.blade.php @@ -8,7 +8,7 @@ @endif
Übersicht der Kurse
Zeige das Benutzer Frontend
diff --git a/resources/views/livewire/book-case/book-case-table.blade.php b/resources/views/livewire/book-case/book-case-table.blade.php new file mode 100644 index 00000000..7a3c08e5 --- /dev/null +++ b/resources/views/livewire/book-case/book-case-table.blade.php @@ -0,0 +1,12 @@ +- Finde Bitcoin Kurse in deiner City
- @php - $searchTitle = match ($currentRouteName) { - 'search.city' => 'Stadt', - 'search.lecturer' => 'Dozent', - 'search.venue' => 'Veranstaltungs-Ort', - 'search.course' => 'Kurs', - 'search.event' => 'Termin', - }; - @endphp - - 👇 {{ $searchTitle }} finden 👇 - -{{-- TEXT --}}
+Wähle deine Stadt, suche im + Umkreis nach + Kursen und wähle ein für dich passendes Thema aus.
--}}
-
+ @if(str(request()->route()->getName())->contains('library.'))
+ Wähle ein für dich passendes + Thema aus.
Suche einen öffentlichen + Bücher-Schrank aus.
+- Finde einen Bücher-Schrank in deiner City
- - 👇 Bücher-Schrank finden 👇 - -{{-- TEXT --}}
-