<?php

namespace App\Livewire;

use Livewire\Component;
use Livewire\Attributes\On;
use Illuminate\Support\Facades\Session;

class Profile extends Component
{
    public $user;

    public function mount()
    {
        $this->user = Session::get('user');

        if (!$this->user) {
            return $this->redirect('/login'); // Livewire 3 way
        }
    }

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