WIP
This commit is contained in:
32
app/Livewire/Image/Grid.php
Normal file
32
app/Livewire/Image/Grid.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Image;
|
||||
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Collection;
|
||||
use Livewire\Component;
|
||||
use Livewire\Attributes\On;
|
||||
|
||||
class Grid extends Component
|
||||
{
|
||||
public Collection $images;
|
||||
|
||||
#[On('image.rotate')]
|
||||
public function rotate(int id, string $direction) : void {
|
||||
$degree = match ($direction) {
|
||||
'ccw' => -90,
|
||||
'cw' => 90,
|
||||
default => 0,
|
||||
}
|
||||
}
|
||||
|
||||
public function mount(Collection $images): void {
|
||||
$this->images = $images;
|
||||
}
|
||||
|
||||
public function render(): View|Factory
|
||||
{
|
||||
return view('livewire.image.grid');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user