update bindle

This commit is contained in:
HolgerHatGarKeineNode
2023-08-03 18:57:10 +02:00
parent a77e178ba8
commit a121bcccad
2 changed files with 16 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ use RalphJSmit\Laravel\SEO\Support\SEOData;
class Gallery extends Component
{
public Collection $bindles;
public string $search = '';
public function mount()
{
@@ -19,6 +20,15 @@ class Gallery extends Component
->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();

View File

@@ -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">
@@ -32,7 +35,8 @@
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;