PHPackages                             sandulat/laravel-dashboard-template - 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. sandulat/laravel-dashboard-template

ActiveLibrary[Admin Panels](/categories/admin)

sandulat/laravel-dashboard-template
===================================

Basic Laravel Dashboard Template

v0.1(6y ago)13331[20 PRs](https://github.com/sandulat/laravel-dashboard-template/pulls)MITCSSPHP ^7.1

Since Jul 12Pushed 3y agoCompare

[ Source](https://github.com/sandulat/laravel-dashboard-template)[ Packagist](https://packagist.org/packages/sandulat/laravel-dashboard-template)[ Docs](https://github.com/sandulat/laravel-dashboard-template)[ RSS](/packages/sandulat-laravel-dashboard-template/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (23)Used By (0)

[![](https://camo.githubusercontent.com/4d43fad38d0701184f785ea146f0208713438994036b340cb07c1244b3806bdf/68747470733a2f2f636f6c746f72617070732e636f6d2f696d616765732f6c64742d73637265656e73686f742e706e67)](https://camo.githubusercontent.com/4d43fad38d0701184f785ea146f0208713438994036b340cb07c1244b3806bdf/68747470733a2f2f636f6c746f72617070732e636f6d2f696d616765732f6c64742d73637265656e73686f742e706e67)

Laravel Dashboard Template
==========================

[](#laravel-dashboard-template)

💫Basic Dashboard Template as a Package.💫

[![](https://camo.githubusercontent.com/02325a927d4af28bce8a7f8f6b3d95b629ee15f25d0239aa71150e93198b9c5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f73616e64756c61742f6c61726174726f6e2e737667)](https://camo.githubusercontent.com/02325a927d4af28bce8a7f8f6b3d95b629ee15f25d0239aa71150e93198b9c5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f73616e64756c61742f6c61726174726f6e2e737667)[![](https://camo.githubusercontent.com/e3d0ffa13c80c7eb1edf308eaf0bf4e15c761c826a0f47facc03f0bb2a66ff86/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616e64756c61742f6c61726174726f6e2e737667)](https://camo.githubusercontent.com/e3d0ffa13c80c7eb1edf308eaf0bf4e15c761c826a0f47facc03f0bb2a66ff86/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616e64756c61742f6c61726174726f6e2e737667)[ ![](https://camo.githubusercontent.com/5f70c0b0d3c19f4dc3409d2840d1f36f36ccdfeadedbd48be69ed87777bae56f/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f73616e64756c61742e7376673f7374796c653d736f6369616c)](https://twitter.com/intent/follow?screen_name=sandulat)

> Note: Not suitable for single page applications as it's built in `Blade`, however you can use Vue/React/etc. components on all pages.

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

[](#installation)

```
composer require sandulat/laravel-dashboard-template
php artisan laravel-dashboard-template:install
```

> Note: to re-publish the front-end assets when updating the package use: `php artisan laravel-dashboard-template:publish`

The `install` command will publish the front-end assets and will create a new service provider `App\Providers\DashboardServiceProvider`. This is basically the main config of the template, but first let's see how to display the dashboard in the next section.

Layout
------

[](#layout)

Create a route and a controller that will return a view. Inside the view place the following code:

`my_view.blade.php:`

```
@extends('laravel-dashboard-template::page')

@section('ldt-content')
    Some content
@endsection
```

> Note: `ldt` stands for `laravel-dashboard-template`.

As you can see `laravel-dashboard-template::page` is just a layout. Besides `ldt-content` the layout provides more additional slots:

- `ldt-head` - Head section for CSS, meta, etc.
- `ldt-scripts` - Scripts section to include JS files.
- `ldt-topbar-left` - Left section of topbar.
- `ldt-topbar-right` - Right section of topbar, next to profile dropdown.
- `ldt-sidebar-footer` - Footer section of sidebar.

To avoid duplication of these slots, it would be better to create your own layout that will extend the package's layout.

`my_layout.blade.php:`

```
@extends('laravel-dashboard-template::page')

@section('ldt-topbar-right')
    Language Select
@endsection
```

So now in your views you can do:

`my_view.blade.php:`

```
@extends('my_layout')

@section('ldt-content')
    Some content
@endsection
```

Card
----

[](#card)

Besides layout, the package provides a card component:

```
@component('laravel-dashboard-template::components.card')
    @slot('title')
        Dahboard
    @endslot

    Content
@endcomponent
```

The result can be seen in the screenshot at the top of the documentation.

Alerts
------

[](#alerts)

Out of the box the package will display 2 types of alerts above the `content` section of the layout. They will be displayed when you redirect with `success` and `error` flash data:

```
return back()->with('success', 'My success message.');
```

```
return back()->with('error', 'My error message.');
```

Configuration
-------------

[](#configuration)

You can configure the dashboard inside the installed provider: `App\Providers\DashboardServiceProvider`. By default it's empty because everything is already configured so you can start building instantly, however you can add the following methods to start customizing the dashboard:

```
/**
 * Topbar user name resolver.
 *
 * @return string
 */
public function userName(): string
{
    return Auth::check() ? Auth::user()->name : 'Guest';
}
```

```
/**
 * Topbar user avatar resolver.
 *
 * @return string
 */
public function userAvatar(): string
{
    if (Auth::check() && Auth::user()->avatar) {
        return Auth::user()->avatar;
    }

    return URL::asset('/vendor/laravel-dashboard-template/images/avatar.svg')
}
```

```
/**
 * Sidebar links.
 *
 * @return array
 */
public function sidebarLinks(): array
{
    return [
        'Menu' => [
            [
                'label' => 'Users',
                'url' => route('users'),
                'children' => [
                    [
                        'label' => 'Active Users',
                        'url' => route('users.active'),
                    ],
                ],
            ],
        ],
    ];
}
```

```
/**
 * Profile dropdown links.
 *
 * @return array
 */
public function profileDropdownLinks(): array
{
    return [
        [
            'label' => 'Edit Profile',
            'url' => route('profile'),
        ],
    ];
}
```

```
/**
 * Logout the user.
 *
 * @param \Illuminate\Http\Request $request
 * @return void
 */
public function logout(Request $request): void
{
    Auth::guard()->logout();

    $request->session()->invalidate();
}
```

```
/**
 * Action to be performed after logout.
 *
 * @return void
 */
public function loggedOut(): void
{
    //
}
```

```
/**
 * Redirect after logout.
 *
 * @return \Illuminate\Http\RedirectResponse
 */
public function logoutRedirect(): RedirectResponse
{
    return redirect('/');
}
```

> Note: Each method from this service provider has dependency injection available.

Customization
-------------

[](#customization)

I've tried to split the template into as many components &amp; partials as possible. Just create inside your project the folder: `resources/views/vendor/laravel-dashboard-template` and now you can copy the files from the package and customize them. Here is the list:

- partials/alert.blade.php
- partials/alert\_error.blade.php
- partials/alert\_success.blade.php
- partials/sidebar.blade.php
- partials/sidebar\_link.blade.php
- partials/sidebar\_logo.blade.php
- partials/topbar\_profile\_dropdown.blade.php

---

- components/card.blade.php
- components/dropdown.blade.php
- components/dropdown\_item.blade.php
- components/topbar.blade.php

Using Vue/React/etc. components
-------------------------------

[](#using-vuereactetc-components)

The main div that wraps the dashboard has an `app` id. You can load your front-end framework onto this id and start using your components on all pages.

```
// Vue
new Vue({
    el: '#app',
});

//React
ReactDOM.render(, document.getElementById('app'));
```

After you'll compile your front-end assets you can include them like this:

```
@section('ldt-head')

@endsection
@section('ldt-scripts')

@endsection
```

> Note: If you don't have [front-end assets versioning](https://laravel.com/docs/5.8/mix#versioning-and-cache-busting) you might want to use the `asset()` method instead of `mix()`.

Custom Logout Button
--------------------

[](#custom-logout-button)

You can hide the default logout button by applying `display: none;` onto id `#ldt-logout-button`. The template already provides a logout system with customizable callbacks, so you can make use of it. Just submit the default "hidden" logout form with Javascript:

```
document.getElementById("ldt-logout-form").submit();
```

Credits
-------

[](#credits)

Created by [Stratulat Alexandru](https://twitter.com/sandulat).

[ ![](https://camo.githubusercontent.com/756d7f35cca5ec8d20b05d608c87ff83462bcb262adc26c28d15de98d216e8c4/68747470733a2f2f636f6c746f72617070732e636f6d2f696d616765732f6c6f676f5f7472616e73706172656e742e706e67)](https://coltorapps.com/)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2544d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47273575?v=4)[allexxander](/maintainers/allexxander)[@Allexxander](https://github.com/Allexxander)

---

Tags

dashboarddashboard-templatelaravellaravel-dashboardtemplatesandulatlaravel-dashboard-template

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sandulat-laravel-dashboard-template/health.svg)

```
[![Health](https://phpackages.com/badges/sandulat-laravel-dashboard-template/health.svg)](https://phpackages.com/packages/sandulat-laravel-dashboard-template)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.6M217](/packages/backpack-crud)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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