<?php

namespace App\Http\Controllers;

use Illuminate\Http\RedirectResponse;
use Illuminate\View\View;

class LandingController extends Controller
{
    public function index(): View|RedirectResponse
    {
        $user = auth()->user();

        if ($user) {
            return redirect()->route($user->isAdmin() ? 'admin.dashboard' : 'user.dashboard');
        }

        return view('user.pages.index');
    }
}
