Skip to main content

Navigation and Items

In the engine, there are standard ways to add items to the Footer, Navbar, and so on. However, modules can independently add items to the template if desired.

To add items to the navigation panel, you can use 2 approaches:

  1. Extend the @stack() navigation
  2. Add through navbar() (Preferred)

We will explore the second approach.

To add the desired item to the navigation panel, I will demonstrate an example:

$navbarItem = new NavbarItem;
$navbarItem->title = "Our New Item";
$navbarItem->url = "Link to the item";
$navbarItem->icon = "ph ph-wallet";
/** Other parameters of the NavbarItem entity can also be specified */

navbar()->add($navbarItem);

Data in the site footer is added in exactly the same way, but the footer() method is called for this:

$footerItem = new FooterItem;

footer()->add($footerItem);

To add links in the footer, simply call the socials() function inside footer():

$footerSocial = new FooterSocial;

/** Follow the same pattern as in the previous example */

footer()->socials()->add($footerSocial);