-
Notifications
You must be signed in to change notification settings - Fork 0
Dashboard boxes
Венелин Илиев edited this page Nov 24, 2016
·
7 revisions
In module routes.php (app\Modules\ < Module > \Http\routes.php) insert this:
if (\Administration::routeInAdministration()) {
//administration menu code
if (\Administration::isDashboard()) {
//insert box code here
}
}
All boxes methods:
$box->setBoxClass('col-md-3'); //set boostrap column class
Preview:
Code:
$box = new \ProVision\Administration\Dashboard\InfoBox();
$box->setTitle('Info box');
$box->setValue('90%');
$box->setIconBoxBackgroundClass('bg-red');
$box->setIconClass('fa-american-sign-language-interpreting');
\Dashboard::add($box);
Preview:
Code:
$box = new \ProVision\Administration\Dashboard\LinkBox();
$box->setTitle('New orders');
$box->setValue('5');
$box->setBoxBackgroundClass('bg-aqua');
$box->setIconClass('fa-shopping-basket');
$box->setLink('View new orders', route('provision.administration.index'));
\Dashboard::add($box);
$box = new \ProVision\Administration\Dashboard\HtmlBox();
$box->setHtml('your html code here');
\Dashboard::add($box);
create class where you want and extends DashboardBox:
class YourBox extends DashboardBox {
}
Implement render method who will return box html code:
public function render() {
return '<div class="' . $this->boxClass . '">your box content here</div>';
}
Add your box in dashboard:
$box = new classNamespace\YourBox();
\Dashboard::add($box);
- Home
- Requirements
- Installation
- Configuration
- Updates
- Modules
- [Dashboard boxes](Dashboard boxes)
- [Artisan commands](Artisan commands)