Skip to content

Commit

Permalink
update bindle
Browse files Browse the repository at this point in the history
  • Loading branch information
HolgerHatGarKeineNode committed Aug 3, 2023
1 parent a77e178 commit a121bcc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/Http/Livewire/Bindle/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class Gallery extends Component
{
public Collection $bindles;
public string $search = '';

public function mount()
{
Expand All @@ -19,6 +20,15 @@ public function mount()
->get();
}

public function updatedSearch($value)
{
$this->bindles = LibraryItem::query()
->where('type', 'bindle')
->where('name', 'ilike', "%{$value}%")
->latest('id')
->get();
}

public function deleteBindle($id)
{
LibraryItem::query()->find($id)?->delete();
Expand Down
8 changes: 6 additions & 2 deletions resources/views/livewire/bindle/gallery.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
</div>

<div>
<h1 class="text-4xl text-white py-8">Sent from my #₿indle🧡</h1>
<div class="flex space-x-6">
<h1 class="text-4xl text-white py-8">Sent from my #₿indle🧡</h1>
<x-input label="{{ __('Suche') }}" wire:model.debounce="search"/>
</div>

<ul role="list"
class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-3 sm:gap-x-6 lg:grid-cols-4 xl:gap-x-8">
Expand All @@ -32,7 +35,8 @@ class="aspect-h-7 aspect-w-10 block w-full rounded-lg bg-gray-100">
class="object-cover">
</a>
</div>
<p class="mt-2 block truncate text-sm font-medium text-gray-100">{{ $bindle->name }}</p>
<p class="mt-2 block truncate text-md font-medium text-gray-100">{{ $bindle->name }}</p>
<p class="mt-2 block truncate text-md font-medium text-gray-100">{{ $bindle->created_at->asDate() }}</p>
<div>
@php
$url = $bindle->value;
Expand Down

0 comments on commit a121bcc

Please sign in to comment.