Installation &amp; setup | laravel-dashboard | Spatie

 SPATIE

  Laravel Dashboard
====================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-dashboard](https://spatie.be/docs/laravel-dashboard/v1)  Installation &amp; setup

 Version   v4   v3   v2   v1

 Other versions for crawler [v4](https://spatie.be/docs/laravel-dashboard/v4) [v3](https://spatie.be/docs/laravel-dashboard/v3) [v2](https://spatie.be/docs/laravel-dashboard/v2) [v1](https://spatie.be/docs/laravel-dashboard/v1)

  Installation &amp; setup
- [ Introduction ](https://spatie.be/docs/laravel-dashboard/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-dashboard/v1/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-dashboard/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-dashboard/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-dashboard/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-dashboard/v1/changelog)
- [ About us ](https://spatie.be/docs/laravel-dashboard/v1/about-us)

Usage
-----

- [ Creating your first dashboard ](https://spatie.be/docs/laravel-dashboard/v1/basic-usage/creating-your-first-dashboard)
- [ Positioning tiles ](https://spatie.be/docs/laravel-dashboard/v1/basic-usage/positioning-tiles)
- [ Customizing the views ](https://spatie.be/docs/laravel-dashboard/v1/basic-usage/customizing-the-views)

Adding tiles
------------

- [ Overview ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/overview)
- [ Creating your own tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/creating-your-own-tile)
- [ Google calendar tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/google-calendar)
- [ Time and Weather tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/time-weather)
- [ Oh Dear Uptime tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/oh-dear-uptime)
- [ Twitter tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/twitter-tile)
- [ Velo tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/velo)
- [ Belgian trains tile ](https://spatie.be/docs/laravel-dashboard/v1/adding-tiles/belgian-trains)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-dashboard                                                                                                                                                                                                                                    `

Installation &amp; setup
========================

You can install the package via composer:

```
composer require spatie/laravel-dashboard
```

To create the `dashboard_tiles` table, you must create and run the migration.

```
php artisan vendor:publish --provider="Spatie\Dashboard\DashboardServiceProvider" --tag="dashboard-migrations"
php artisan migrate
```

You must publish the `dashboard` config file with this command.

```
php artisan vendor:publish --provider="Spatie\Dashboard\DashboardServiceProvider" --tag="dashboard-config"
```

This is the content of the published config file:

```
return [
    /*
     * The dashboard supports these themes:
     *
     * - light: always use light mode
     * - dark: always use dark mode
     * - device: follow the OS preference for determining light or dark mode
     * - auto: use light mode when the sun is up, dark mode when the sun is down
     */
    'theme' => 'light',

    /*
     * When the dashboard uses the `auto` theme, these coordinates will be used
     * to determine whether the sun is up or down
     */
    'auto_theme_location' => [
        'lat' => 51.260197,
        'lng' => 4.402771,
    ],
];
```

In order for the dashboard to run constantly without anybody having to refresh it every once in a while, you need to add an exception for Livewire routes in your `VerifyCsrfToken` middleware:

```
protected $except = [
    '/livewire/*',
];
```

Livewire uses AJAX requests to update the components. Those AJAX requests contain a [CSRF token](https://laravel.com/docs/7.x/csrf#csrf-x-csrf-token), and at some point that token will expire and you will see a `419 Page Expired` error in your dashboard. This will prevent it from happening.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
