<?php

use Livewire\Component;
use App\Models\Gallery;

return new class extends Component
{
    public function render()
    {
        return $this->view()->layout('layouts::auth');
    }

    public function delete($id)
    {
        Gallery::find($id)->delete();
        session()->flash('message', 'Gallery item removed successfully.');
    }

    public function with()
    {
        return [
            'items' => Gallery::with('category')->latest()->get(),
        ];
    }

    protected function view($data = [])
    {
        return app('view')->file('D:\02-my freelance\00-DR_Padhi\DR_PADHI\storage\framework/views/livewire/views/aa5a6ef3.blade.php', $data);
    }
};
