No, I didn't set any permission to access the dashboard.
Here's the code:
App.php > sidebar()
protected function sidebar()
{
return [
"Sales"=>Group::create()->icon("fa fa-line-chart")->sub([
"Invoices"=>InvoiceBoard::create(),
"Revenues"=>RevenuesBoard::create(),
])
];
}
InvoiceBoard.php
protected function onInit()
{
$this->default(true)
->title("Home")
->hidden(false)
->icon("fa fa-home")
->updateEffect("fade");
}
protected function widgets()
{
return [
Html::h2("Invoice List"),
Row::create()->sub([
Row::create(),
InvoiceDateRange::create()->width(1/3),
]),
Row::create()->sub([
TotalInvoice::create()->type("primary")->width(1/3)->lazyLoading(true),
InvoiceAmount::create()->type("warning")->width(1/3)->lazyLoading(true),
InvoiceStatus::create()->type("success")->width(1/3)->lazyLoading(true),
]),
Panel::create()->header("Invoice List")->type("danger")->sub([
Dropdown::create("exportOptions")
->title("<i class='far fa-file-pdf'></i> Export To PDF")
->items([
"Export Current Page"=>MenuItem::create()
->onClick(
Client::showLoader().
Client::widget("InvoiceTable")->exportToPDF("Invoices - Current Page",["all"=>false])
),
"Export All"=>MenuItem::create()
->onClick(
Client::showLoader().
Client::widget("InvoiceTable")->exportToPDF("All Invoice",["all"=>true])
),
])
->align("right")
->cssStyle("margin-bottom:15px;")
->cssClass("text-right"),
InvoiceTable::create()->lazyLoading(true),
]),
];
}