Sindbad~EG File Manager

Current Path : /var/www/html/carsanies.sumar.com.py/app/Http/Livewire/
Upload File :
Current File : /var/www/html/carsanies.sumar.com.py/app/Http/Livewire/Bandeja.php

<?php

namespace App\Http\Livewire;

use Livewire\Component;
use App\Models\ContactoModel;


class Bandeja extends Component
{
    public function render()
    {
        $contactos = ContactoModel::paginate(10);
        return view('livewire.bandeja', ['contactos' => $contactos]);
    }

    public function leido($id)
    {
        $contacto=ContactoModel::find($id);
        $contacto->estado='leido';
        $contacto->save();
    
        $this->emit('alert', ['type' => 'success', 'message' => '¡El mensaje fue marcado como  leido correctamente.!']);
    }

    public function delete($id)
    {
        $contacto = ContactoModel::find($id);
        if ($contacto) {
            $contacto->delete();
            $this->emit('alert', ['type' => 'success', 'message' => '¡El mensaje fue borrado correctamente!']);
        } else {
            $this->emit('alert', ['type' => 'error', 'message' => '¡El mensaje no fue encontrado!']);
        }
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists