<?php

namespace App\Http\Controllers\Dashboard;

use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\Support\Facades\Auth;

class DataDisplayController extends Controller
{
    public function index(Request $request)
    {
        $user = Auth::user();
        if (!$user) {
            return redirect()->route('login');
        }

        $data = User::all();
        $layout = 'horizontal';
        $avatar = true;
        $viewPath = '/view';
        $header = 'User List';
        $footer = 'Total: ' . count($data) . ' users';

        return view('dashboard.data-display', compact('data', 'layout', 'avatar', 'viewPath', 'header', 'footer'));
    }
}