<?php

use App\Models\Pouzivatel\Pouzivatel;
use Diglactic\Breadcrumbs\Breadcrumbs;

Breadcrumbs::for('portal.sprava.index', function ($trail) {
    $trail->parent('portal.plocha');
    $trail->push('Správa', route('portal.sprava.index'));
});

Breadcrumbs::for('portal.sprava.pouzivatelia.index', function ($trail) {
    $trail->parent('portal.sprava.index');
    $trail->push('Používatelia', route('portal.sprava.pouzivatelia.index'));
});

Breadcrumbs::for('portal.sprava.pouzivatelia.edit', function ($trail, $pouzivatelId) {
    $pouzivatel = Pouzivatel::query()->findOrFail($pouzivatelId);

    $trail->parent('portal.sprava.pouzivatelia.index');
    $trail->push($pouzivatel->cele_meno, route('portal.sprava.pouzivatelia.edit', $pouzivatel));
});

Breadcrumbs::for('portal.sprava.pouzivatelia.akcie.index', function ($trail, $pouzivatelId) {
    $pouzivatel = Pouzivatel::query()->findOrFail($pouzivatelId);

    $trail->parent('portal.sprava.pouzivatelia.index');
    $trail->push($pouzivatel->cele_meno, route('portal.sprava.pouzivatelia.edit', $pouzivatel));
});

Breadcrumbs::for('portal.sprava.pouzivatelia.spravy.index', function ($trail) {
    $trail->parent('portal.sprava.index');
    $trail->push('Správy', route('portal.sprava.pouzivatelia.spravy.index'));
});

Breadcrumbs::for('portal.sprava.moduly.index', function ($trail) {
    $trail->parent('portal.sprava.index');
    $trail->push('Moduly', route('portal.sprava.moduly.index'));
});