Files
einundzwanzig-portal/app/Http/Livewire/Bindle/Gallery.php
HolgerHatGarKeineNode 0c820be43b Implement feature flags and update views
This commit implements feature flags using the "ylsideas/feature-flags" library and updates various frontend views to show or hide sections based on the feature flag. Additionally, a new migration file is created for the features database table and the LibraryItem model is updated with a new searchLibraryItems function. The composer.json and composer.lock files are updated to include the new dependencies.
2023-12-08 21:40:48 +01:00

44 lines
1.0 KiB
PHP

<?php
namespace App\Http\Livewire\Bindle;
use App\Models\LibraryItem;
use Illuminate\Database\Eloquent\Collection;
use Livewire\Component;
use RalphJSmit\Laravel\SEO\Support\SEOData;
class Gallery extends Component
{
public Collection $bindles;
public string $search = '';
public function mount()
{
$this->bindles = LibraryItem::searchLibraryItems('bindle');
}
public function updatedSearch($value)
{
$this->bindles = LibraryItem::searchLibraryItems('bindle', $value);
}
public function deleteBindle($id)
{
LibraryItem::query()->find($id)?->delete();
return to_route('bindles');
}
public function render()
{
return view('livewire.bindle.gallery')
->layout('layouts.app', [
'SEOData' => new SEOData(
title: __('Bindle Gallery'),
description: __('Die berühmte Bindlesammlung von FiatTracker.'),
image: asset('img/fiat_tracker.jpg'),
),
]);
}
}