https://github.com/sadi01/yii2-bi-dashboard
BI dashboard for Yii 2 framework
https://github.com/sadi01/yii2-bi-dashboard
Last synced: 5 months ago
JSON representation
BI dashboard for Yii 2 framework
- Host: GitHub
- URL: https://github.com/sadi01/yii2-bi-dashboard
- Owner: Sadi01
- License: bsd-3-clause
- Created: 2023-05-13T10:22:43.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-02T04:31:22.000Z (about 1 year ago)
- Last Synced: 2024-11-10T09:41:06.471Z (6 months ago)
- Language: PHP
- Size: 14.8 MB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Business intelligence dashboard for Yii 2
# Bidashboard
**Bidashboard** is a data visualization dashboard designed to provide insights into key metrics and data for business
intelligence purposes. It allows users to monitor and analyze various aspects of their business in real-time through
interactive charts and graphs.This extension provides the Business Intelligence Dashboard for the [Yii framework 2.0](http://www.yiiframework.com).
For license information check the [LICENSE](LICENSE.md)-file.
Installation
------------### Using Composer (Preferred Method):
The preferred way to install this extension is through [composer](http://getcomposer.org/download/):
```
composer require --prefer-dist sadi01/yii2-bi-dashboard:"*"
```### Alternative Method:
If you prefer adding the bidashboard extension to your `composer.json` file manually, you can do so by adding the
following entry to the `require` section:```json
{
"require": {
"sadi01/yii2-bi-dashboard": "*"
}
}
```After adding the entry, save the `composer.json` file and run the following command in the terminal or command prompt
within your project directory:```
composer update
```This command will fetch and install the bidashboard extension and its required dependencies into your Yii 2 project.
Configuration
-------------To use this extension, you have to configure the bidashboard module in your application configuration:
```php
return [
//....
'modules' => [
'bidashboard' => [
'class' => 'sadi01\bidashboard\Module',
],
]
];
```Env
-------------
You have to add the database configuration to env, its example is in - [Env.example](./src/env-config/.env.example)DB Migrations
-------------Run module migrations:
```php
php yii migrate --migrationPath=@sadi01/bidashboard/migrations
```Or, Add migrations path in console application config:
```php
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationNamespaces' => [],
'migrationPath' => [
'@vendor/sadi01/yii2-bi-dashboard/src/migrations',
'@app/migrations'
]
],
],
```How To Use
-------------
add to view model:```php
use sadi01\bidashboard\widgets\ReportModalWidget;= ReportModalWidget::widget([
'queryParams' => $queryParams,
'searchModel' => $searchModel,
'searchModelMethod' => $searchWidget,
'searchModelRunResultView' => $searchModelRunResultView,
'searchRoute' => Yii::$app->request->pathInfo,
'searchModelFormName' => $searchModelFormName,
'outputColumn' => $outputColumn,
]) ?>
```add to search model:
```php
public function searchWidget(array $params,int $rangeType,int $startRange,int $endRange)
{
$query = Invoice::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params, '');
$query->andFilterWhere(['between', 'created_at', $startRange, $endRange]);
if ($rangeType == ReportWidget::RANGE_TYPE_MONTHLY) {
...
}
elseif ($rangeType == ReportWidget::RANGE_TYPE_DAILY) {
...
}
return $dataProvider;
}
```
Advanced config
-------------
- [Installation Guide](./src/guide/installation.md)- [Description Guide](./src/guide/description.md)
- [Usage Guide](./src/guide/usage.md)
- [Access Control Guide (RBAC)](./src/guide/rbac.md)