<?php

namespace App\Filament\Student\Pages;

use Filament\Pages\Page;

class Certificates extends Page
{
    protected string $view = 'filament.student.pages.certificates';

    protected static ?string $navigationLabel = 'Certificates';

    protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-academic-cap';

    protected static ?int $navigationSort = 5;

    public function getViewData(): array
    {
        return [
            'certificates' => \App\Models\Certificate::where('user_id', auth()->id())
                ->with('course')
                ->latest()
                ->get(),
        ];
    }
}
