diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 6a8084e..5f4b9d4 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -7,6 +7,11 @@ class ItemController extends Controller { + public function guest(): View + { + return view('templates.item.guest'); + } + public function index(): View { return view('templates.item.index'); diff --git a/app/Livewire/ItemsGuest.php b/app/Livewire/ItemsGuest.php new file mode 100644 index 0000000..a323d17 --- /dev/null +++ b/app/Livewire/ItemsGuest.php @@ -0,0 +1,34 @@ +items = Item::all(); + $this->tags = Tag::all(); + } + + public function render() + { + return view('livewire.items-guest'); + } + + public function filter($tagId = null) + { + if ($tagId == null) { + $this->items = Item::all(); + return; + } + + $this->items = Tag::find($tagId)->items; + } +} diff --git a/resources/views/components/card.blade.php b/resources/views/components/card.blade.php new file mode 100644 index 0000000..1a352d1 --- /dev/null +++ b/resources/views/components/card.blade.php @@ -0,0 +1,21 @@ +@props([ + 'name' => '', + 'image' => null, + 'description' => '', + 'tags' => [], +]) + +
{{ $description }}
+