PHPackages                             plank/frontdesk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. plank/frontdesk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

plank/frontdesk
===============

v12.0.0(11mo ago)14.7k↑42.9%[3 PRs](https://github.com/plank/frontdesk/pulls)MITPHPPHP ^8.2|^8.3CI passing

Since Oct 24Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/plank/frontdesk)[ Packagist](https://packagist.org/packages/plank/frontdesk)[ Docs](https://github.com/plank/frontdesk)[ RSS](/packages/plank-frontdesk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (13)Versions (15)Used By (0)

[![](https://raw.githubusercontent.com/plank/frontdesk/main/.github/img-frontdesk%402x.png)](https://plank.co)

[![PHP Version Support](https://camo.githubusercontent.com/ade3789a55c44bafe1fd5f9d9d95ee9ae36e64607a1801a6d804ad1a036186b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706c616e6b2f66726f6e746465736b3f636f6c6f723d253233666165333730266c6162656c3d706870266c6f676f3d706870266c6f676f436f6c6f723d253233666666)](https://packagist.org/packages/plank/frontdesk)[![GitHub Workflow Status](https://camo.githubusercontent.com/a04a20ece79ddd976f515dfa687d80e3b5eeeaea6e70353e2f84456fc06459ec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706c616e6b2f66726f6e746465736b2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e2626636f6c6f723d253233626663396264266c6162656c3d72756e2d7465737473266c6f676f3d676974687562266c6f676f436f6c6f723d253233666666)](https://github.com/plank/frontdesk/actions?query=workflow%3Arun-tests)[![](https://camo.githubusercontent.com/d20067b4209e3b867e0f1246766db33ed29582ea85be83d1d8934e2467ce3f0a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f706c616e6b2f66726f6e746465736b3f636f6c6f723d253233666639333736266c6162656c3d74657374253230636f766572616765266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d253233666666)](https://codeclimate.com/github/plank/frontdesk/test_coverage)[![](https://camo.githubusercontent.com/62d692fd7e5d681297d000aa14b1e2cbd09f18fe1765ea2b12a109c3da6984c7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f706c616e6b2f66726f6e746465736b3f636f6c6f723d253233353238636666266c6162656c3d6d61696e7461696e61626c696c697479266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d253233666666)](https://codeclimate.com/github/plank/frontdesk/maintainability)

Frontdesk
=========

[](#frontdesk)

Frontdesk simplifies the way you build a navigation bar using models within your Laravel application. Frontdesk treats a navigation menu like any other model, so you can have total, and dynamic control over the contents of your menus.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require plank/frontdesk
```

Usage
-----

[](#usage)

Frontdesk separates the concept of a navigation bar into 2 parts: the `Menu` and the `Hyperlink`. A `Menu` is a collection of `Hyperlink`s. Each `Hyperlink` can have a parent `Hyperlink` and a collection of child `Hyperlink`s.

To that end you may have content that is "linkable" and content that is "menuable".

To use Frontdesk simply add the traits and implement the corresponding interfaces on your models.

### Linkable

[](#linkable)

```
class MyModel extends Model implements Linkable
{
    use IsLinkable;

    public function linkTitle(): Attribute
    {
        return Attribute::make(
            get: fn () => $this->title
        );
    }

    public function linkUrl(): Attribute
    {
        return Attribute::make(
            get: fn () => route('my-model.show', $this)
        );
    }
}
```

### Menuable

[](#menuable)

```
class MyMenuModel extends Model implements Menuable
{
    use HasMenus;
}
```

### Saving Menus &amp; Links

[](#saving-menus--links)

Once you have a few models that implement the appropriate interfaces you can start building your navigation bar.

```
// Create a menu
$myMenu = MyMenuModel::find(1)->menus()->create([
    'identifier' => 'header-nav'
]);
$myOtherMenu = MyMenuModel::find(1)->menus()->create([
    'identifier' => 'footer-nav'
]);

// Create a hyperlink referencing
$myModelLink = MyModel::find(1)->hyperlinks()->create([
    'menu_id' => $myMenu->id,
]);

// A link also doesn't strictly need to be attached to a model
$myMenuLink = Hyperlink::create([
    'menu_id' => $myMenu->id,
    'title' => 'My Link',
    'url' => 'https://example.com',
]);

// You can also associate an existing hyperlink to an existing menu
$myMenuLink->menus()->associate($myOtherMenu)->save();
```

### Getting Menus &amp; Links

[](#getting-menus--links)

After building a few menus, you can retrieve them using the `Menu` model, or via a model's relation to the `Menu` model.

```
// Get a menu by identifier
$myMenu = Menu::where('identifier', 'header-nav')->first();

// Via a model relationship
$myMenu = MyMenuModel::find(1)->menus()->where('identifier', 'header-nav')->first();
```

Getting links out of the menu is as simple as calling the `hyperlinks` relationship on the `Menu` model.

```
$myMenu->hyperlinks;
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email [](mailto:security@plankdesign.com) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Massimo Triassi](https://github.com/m-triassi)
- [Kurt Friars](https://github.com/kfriars)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance51

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~24 days

Total

8

Last Release

342d ago

Major Versions

v1.0.1 → 11.x-dev2025-03-05

v10.0.0 → 12.x-dev2025-06-10

PHP version history (4 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.1|^8.2

11.x-devPHP ^8.2

12.x-devPHP ^8.2|^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/108450?v=4)[Plank](/maintainers/Plank)[@plank](https://github.com/plank)

---

Top Contributors

[![m-triassi](https://avatars.githubusercontent.com/u/9440691?v=4)](https://github.com/m-triassi "m-triassi (52 commits)")[![kfriars](https://avatars.githubusercontent.com/u/3378675?v=4)](https://github.com/kfriars "kfriars (1 commits)")

---

Tags

laravelnavigationplankfrontdesk

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/plank-frontdesk/health.svg)

```
[![Health](https://phpackages.com/badges/plank-frontdesk/health.svg)](https://phpackages.com/packages/plank-frontdesk)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
