2026-01-22 23:38:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Livewire;
|
|
|
|
|
|
|
|
|
|
use App\Models\Feed;
|
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
|
|
class Feeds extends Component
|
|
|
|
|
{
|
|
|
|
|
public function toggle(int $feedId): void
|
|
|
|
|
{
|
|
|
|
|
$feed = Feed::findOrFail($feedId);
|
2026-03-08 14:18:28 +01:00
|
|
|
$feed->is_active = ! $feed->is_active;
|
2026-01-22 23:38:00 +01:00
|
|
|
$feed->save();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-08 14:18:28 +01:00
|
|
|
public function render(): \Illuminate\Contracts\View\View
|
2026-01-22 23:38:00 +01:00
|
|
|
{
|
|
|
|
|
$feeds = Feed::orderBy('name')->get();
|
|
|
|
|
|
|
|
|
|
return view('livewire.feeds', [
|
|
|
|
|
'feeds' => $feeds,
|
|
|
|
|
])->layout('layouts.app');
|
|
|
|
|
}
|
|
|
|
|
}
|