<?php

// Plocha
use App\Models\Informacia\Informacia;
use Diglactic\Breadcrumbs\Breadcrumbs;

Breadcrumbs::for('portal.plocha', function ($trail) {
    $trail->push('Portál', route('portal.plocha'));
});

Breadcrumbs::for('portal.pouzivatel', function ($trail) {
    $trail->parent('portal.plocha');
    $trail->push('Používateľ', null);
});

Breadcrumbs::for('portal.informacie.index', function ($trail) {
    $trail->parent('portal.plocha');
    $trail->push('Informácie', route('portal.informacie.index'));
});

Breadcrumbs::for('portal.informacie.show', function ($trail, $informaciaId) {
    $informacia = Informacia::query()->findOrFail($informaciaId);

    $trail->parent('portal.informacie.index');
    $trail->push($informacia->titulok, route('portal.informacie.show', $informacia));
});

Breadcrumbs::for('portal.pouzivatel.notifikacie.index', function ($trail) {
    $trail->parent('portal.pouzivatel');
    $trail->push('Notifikácie', null);
});
