WIP
This commit is contained in:
@@ -8,7 +8,6 @@ use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Livewire\Attributes\Locked;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
use App\Models\Album;
|
||||
use App\Models\Image;
|
||||
@@ -42,6 +41,11 @@ class Show extends Component
|
||||
$this->redirect(route('album.show', $this->album), navigate: true);
|
||||
}
|
||||
|
||||
#[On('image.makeCover')]
|
||||
public function makeCover(int $image_id):void {
|
||||
Image::findOrFail($image_id)->makeCover();
|
||||
}
|
||||
|
||||
private function dispatchRotateJob(Image $image, int $degrees) : void {
|
||||
$image->update([
|
||||
'isProcessing' => true,
|
||||
@@ -57,9 +61,9 @@ class Show extends Component
|
||||
])->dispatch();
|
||||
}
|
||||
|
||||
#[Title('Show Album')]
|
||||
public function render(): View|Factory
|
||||
{
|
||||
return view('livewire.album.show');
|
||||
return view('livewire.album.show')
|
||||
->title($this->album->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,22 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Livewire\Component;
|
||||
use App\Models\Tag;
|
||||
use App\Models\Category;
|
||||
use Livewire\Attributes\Computed;
|
||||
|
||||
class CategoryFilter extends Component
|
||||
{
|
||||
public ?Tag $filter = null;
|
||||
|
||||
public function setFilter(int $filter) {
|
||||
#[Computed]
|
||||
public function categories() : Collection {
|
||||
return $this->filter?->categories ?? Category::all();
|
||||
}
|
||||
|
||||
public function setFilter(int $filter) : void {
|
||||
$this->filter = Tag::find($filter);
|
||||
}
|
||||
|
||||
@@ -18,7 +25,6 @@ class CategoryFilter extends Component
|
||||
{
|
||||
return view('livewire.category-filter', [
|
||||
'tags' => Tag::all(),
|
||||
'categories' => Category::all(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
19
app/Livewire/Menu.php
Normal file
19
app/Livewire/Menu.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Menu extends Component
|
||||
{
|
||||
public string $title;
|
||||
|
||||
public function mount(?string $title) : void {
|
||||
$this->title = $title ?? config('app.name');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.menu');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user