<?php

namespace App\Livewire;

use App\Models\SocialLink;
use Livewire\Component;

class Menu extends Component
{
    public $whatsappLink;

    public function mount()
    {
        $whatsapp = SocialLink::where('name', 'Whatsapp')->first();
        $this->whatsappLink = $whatsapp->link;
    }

    public function render()
    {
        return view('livewire.menu');
    }

    public function logout()
    {
        auth()->logout();
        return redirect()->route('welcome');
    }
}
