# Dashboard and Reports

This module allows you to add multiple Report Widgets to your Dashboard. There are five types of Widgets, each with its own parameters.

![](https://laraveldaily.com/wp-content/uploads/2019/03/module-dashboard-reports-widget.png)

&#x20;You can create as many widgets as you want, specifying width for each of them, this way constructing your whole dashboard.

&#x20;Video demo of the module:

{% embed url="<https://www.youtube.com/watch?v=O3ESvZMF9C0>" %}

\
&#x20;In downloaded code, we generate **HomeController.php** which may look like this:

```
use LaravelDaily\LaravelCharts\Classes\LaravelChart;

class HomeController
{
    public function index()
    {
        $settings1 = [
            'chart_title'        => 'Users By Day',
            'chart_type'         => 'line',
            'report_type'        => 'group_by_date',
            'model'              => 'App\User',
            'group_by_field'     => 'created_at',
            'group_by_period'    => 'day',
            'aggregate_function' => 'count',
            'filter_field'       => 'created_at',
            'filter_days'        => '30',
            'column_class'       => 'col-md-12',
            'entries_number'     => '5',
        ];

        $chart1 = new LaravelChart($settings1);

        $settings2 = [
            'chart_title'        => 'Latest Users',
            'chart_type'         => 'latest_entries',
            'report_type'        => 'group_by_date',
            'model'              => 'App\User',
            'group_by_field'     => 'email_verified_at',
            'group_by_period'    => 'day',
            'aggregate_function' => 'count',
            'filter_field'       => 'created_at',
            'column_class'       => 'col-md-12',
            'entries_number'     => '5',
            'fields'             => [
                '0' => 'name',
                '1' => 'email',
                '2' => 'created_at',
            ],
        ];

        $settings2['data'] = $settings2['model']::latest()
            ->take($settings2['entries_number'])
            ->get();

        return view('home', compact('chart1', 'settings2'));
    }
}
```

\
&#x20;You can also group entries by relationships, see video:

{% embed url="<https://www.youtube.com/watch?v=geYLwf8jLCU>" %}

&#x20;For viewing charts, we use our own simple package called [Laravel Charts](https://github.com/LaravelDaily/laravel-charts).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpdocs.quickadminpanel.com/modules/dashboard-and-reports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
