PHPackages                             digihood/digihood-admin-bar - 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. [Admin Panels](/categories/admin)
4. /
5. digihood/digihood-admin-bar

ActiveLibrary[Admin Panels](/categories/admin)

digihood/digihood-admin-bar
===========================

03[1 issues](https://github.com/digihood/digihood-admin-bar/issues)[1 PRs](https://github.com/digihood/digihood-admin-bar/pulls)PHP

Since Oct 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/digihood/digihood-admin-bar)[ Packagist](https://packagist.org/packages/digihood/digihood-admin-bar)[ RSS](/packages/digihood-digihood-admin-bar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Introduction
============

[](#introduction)

This package help you add Wordpress like admin bar to your Laravel application. Admin bar is an easy-to-access toolbar to your admin pages.

[![admin-bar](https://raw.githubusercontent.com/shrft/laravel-admin-bar/master/resources/images/adminbar-image.png)](https://raw.githubusercontent.com/shrft/laravel-admin-bar/master/resources/images/adminbar-image.png)

Supported Version
=================

[](#supported-version)

- laravel/framework &gt;= 5.5

Installation
============

[](#installation)

To instal laravel-admin-bar, require it by Composer:

```
composer require shrft/laravel-admin-bar

```

Once Composer is done, run the following command:

```
php artisan vendor:publish --provider="Digihood\AdminBar\AdminBarServiceProvider"

```

Basic Usage
===========

[](#basic-usage)

You can configure how and when admin bar should be shown via the configuration file called `adminbar.php`. If you have already run the publish command above, you should already have this file under the config directory.

The following is the default setup of the `adminbar.php`You can learn how to configure Admin Bar from the doc blocks of this file.

```
return array(

    /**
     *
     * Change this to false to disable admin bar
     *
     * */
    'enabled'=>true,

    /**
     *
     * Please specify your admin pages' url so that Admin Bar does not show up in
     * your admin pages.
     *
     * The default is 'admin/*'
     * When loading Admin Bar, It checks if current url matches the path set here with Illuminate\Http\Request::is().
     *
     * */
    'excludes' => 'admin/*',

    /**
     *
     * In order to show Admin Bar only for logged in admin users,
     * please specify how to tell if current visitor is logged in and also an admin
     * user.
     *
     * As a default, we just return true.
     *
     * */
    'is_admin' => function(){

       // This is an example code.
       //
       // if( Auth::user() &&  Auth::user()->isAdmin()){
       //     return true;
       // }
       // return false;

        return true;
    },
    /**
     *
     * Specify links to show on Admin Bar.
     *
     * */
    'menus' => array(
        ['title'=>'Admin Top', 'path'=>'/admin'],
        ['title'=>'Add a post', 'path'=>'/admin/post/new'],
        ),
);
```

Advanced Configuration
======================

[](#advanced-configuration)

### Generate path dynamically

[](#generate-path-dynamically)

You can pass a callback to `path` in the array `menus` and you can access `Illuminate\HttpRequest $request` within the callback so that you can generate link dynamically based on the current url.

### How to add `edit this post` link in every post page

[](#how-to-add-edit-this-post-link-in-every-post-page)

Assume you have the following 2 routes, the first one is for post pages and the second one is the edit page of the posts.

```
# article page
Route::get('/post/{id}', ['uses'=>'PostController@show']);

# page to edit an article
Route::get('/admin/post/edit/{id}', ['uses'=>'Admin\PostController@edit']);
```

Then, you can do something like this.

```
'menus' => array(
        ['title'=>'Admin Top', 'path'=>'/admin'],
        ['title'=>'edit this post',
         'path'=>function($request){
                    $postid = $request->route('id');
                    return '/admin/post/edit/' . $postid;
                 },
         'filter'=>'post/*'],
        ),
```

The `filter` is explained below. In the above, it means show `edit this post` link only when current page's path start with `post/`.

### Filter

[](#filter)

You can configure Admin Bar so that a link show up only in a specific condition.

For example, if you want to show `Add Post` link only when you are visiting pages of which url path start with 'post/', you can set filter option like below.

```
'menus' => array(
        ['title'=>'Admin Top', 'path'=>'/admin'],
        ['title'=>'Add Post', 'path'=>'/admin/post/new', 'filter'=>'post/*'],
        )
```

Admin Bar checks if the current url matches the path set in the filter with `Illuminate\Http\Request::is()` and show the link only when it returns true.

You can also pass callback to the filter option if you need more advanced configuration.

If you want to show `Add Post` link only to a user with role `author`, you might do something like this.

```
'menus' => array(
        ['title'=>'Admin Top', 'path'=>'/admin'],
        ['title'=>'Add Post',
         'path'=>'/admin/post/new',
         'filter'=>function($request){
             return Auth::user()->isRole('author');
            }],
        )
```

You have access to `Illuminate\HttpRequest $request` in the callback here as well.

### Drop Down Menu

[](#drop-down-menu)

You can add drop down menu to Admin Bar. To create drop down, pass an array to `path`.

```
'menus' => array(
        ['title'=>'Admin Top', 'path'=>'/admin'],
        ['title'=>'Drop Down', 'path'=>[
                                 ['title'=>'Option1', 'path'=>'/path/to/option1'],
                                 ['title'=>'Option2', 'path'=>'/path/to/option2']
                                ]
        ],
        ),
```

Lincense
========

[](#lincense)

Laravel Admin Bar is open-sourced software licensed under the MIT license.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d59f5794f87ad43f7c8f52121b00704f8330015b250fdf4fbaaf7fed4372a6ac?d=identicon)[WeDesIn](/maintainers/WeDesIn)

---

Top Contributors

[![digihood](https://avatars.githubusercontent.com/u/28844215?v=4)](https://github.com/digihood "digihood (5 commits)")

### Embed Badge

![Health badge](/badges/digihood-digihood-admin-bar/health.svg)

```
[![Health](https://phpackages.com/badges/digihood-digihood-admin-bar/health.svg)](https://phpackages.com/packages/digihood-digihood-admin-bar)
```

###  Alternatives

[jeroennoten/laravel-adminlte

Easy AdminLTE integration with Laravel

4.0k4.8M43](/packages/jeroennoten-laravel-adminlte)[dmstr/yii2-adminlte-asset

AdminLTE backend theme asset bundle for Yii 2.0 Framework

1.1k1.8M67](/packages/dmstr-yii2-adminlte-asset)[dwij/laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like CRUD Generation, Module Manager, Media, Menus, Backups and much more

1.6k68.7k](/packages/dwij-laraadmin)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1764.8M125](/packages/filament-spatie-laravel-media-library-plugin)[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

193195.9k13](/packages/bezhansalleh-filament-exceptions)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1220.8M36](/packages/filament-infolists)

PHPackages © 2026

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