KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Error when using App::create()->run() #3270

Closed Newton opened this topic on on Mar 20 - 7 comments

Newton commented on Mar 20

Please, I need help using the Dashboard from a Laravel application.

I'm following the quickstart but when I use App::create()->run() an error occurs.

Can you send me a guide on how I can initialize the Dashboard?

ErrorException: Undefined array key "" in /home/master/git/laravel/integrate/vendor/koolreport/dashboard/Application.php:361 Stack trace: #0 /home/master/git/laravel/integrate/vendor/koolreport/dashboard/Application.php(361): koolreport\dashboard\Application::koolreport\dashboard\{closure}() #1 /home/master/git/laravel/integrate/vendor/koolreport/dashboard/Application.php(300): koolreport\dashboard\Application->view() #2 /home/master/git/laravel/integrate/vendor/koolreport/dashboard/Application.php(231): koolreport\dashboard\Application->handle() #3 /home/master/git/laravel/integrate/app/Http/Controllers/Itg/Web/PhilipsBrazil/MyReportController.php(14): koolreport\dashboard\Application->run() #4 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Galileo\Http\Controllers\Itg\Web\PhilipsBrazil\MyReportController->index() #5 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction() #6 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch() #7 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController() #8 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Route->run() #9 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}() #10 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #11 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then() #12 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack() #13 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute() #14 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute() #15 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch() #16 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() #17 /home/master/git/laravel/integrate/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #18 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\DisableBrowserCache->handle() #19 /home/master/git/laravel/integrate/vendor/laravel/nova/src/Http/Middleware/ServeNova.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #20 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\Nova\Http\Middleware\ServeNova->handle() #21 /home/master/git/laravel/integrate/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #22 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle() #23 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #24 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #25 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle() #26 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #27 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #28 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle() #29 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #30 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle() #31 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #32 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle() #33 /home/master/git/laravel/integrate/vendor/hyn/multi-tenant/src/Middleware/EagerIdentification.php(29): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #34 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Hyn\Tenancy\Middleware\EagerIdentification->handle() #35 /home/master/git/laravel/integrate/vendor/hyn/multi-tenant/src/Middleware/HostnameActions.php(75): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #36 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Hyn\Tenancy\Middleware\HostnameActions->handle() #37 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #38 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then() #39 /home/master/git/laravel/integrate/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() #40 /home/master/git/laravel/integrate/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle() #41 /home/master/.config/composer/vendor/cpriego/valet-linux/server.php(239): require('...') #42 {main}
KoolReport commented on Mar 21

Can you post some of your code?

Newton commented on Mar 21

MyReportController.php

use Galileo\Custom\Itg\Reports\DashboardApp;
use Galileo\Http\Controllers\Controller;

class MyReportController extends Controller
{
  public function index() {

    DashboardApp::create()->run();

  }

}

DashboardApp.php

use koolreport\dashboard\Application;
class DashboardApp extends Application
{

  protected function dashboards()
  {
    return [
      "PaymentBoard"=> PaymentBoard::create(),
    ];
  }

}

PaymentBoard.php

use \koolreport\dashboard\Dashboard;


class PaymentBoard extends Dashboard
{

  protected function content()
  {
    return [
      PaymentTable::create()
    ];
  }
}

PaymentTable.php

use koolreport\dashboard\fields\Number;
use koolreport\dashboard\fields\Text;
use koolreport\dashboard\widgets\Table;

class PaymentTable extends Table
{
  protected function dataSource()
  {
    return [
      ['name' => 'João', 'age' => 50],
      ['name' => 'Carlos', 'age' => 30]
    ];

  }

  protected function fields()
  {
    return [
      Text::create("name"),
      Number::create("age")
    ];
  }

}
KoolReport commented on Mar 22

It seems a simple application, I spotted no errors on it. Please let me know your version of PHP and the version of Dashboard Framework. I would like to trace where the error occur. Does it occur if you use it outside of laravel?

Newton commented on Mar 22

I replaced the class name from DashboardApp to App and it worked, but the theme is not working. When I use use \koolreport\laravel\Friendship the error ErrorException Undefined property: Galileo\Custom\Itg\Reports\App::$reportSettings.

KoolReport commented on Mar 25

The koolreport\laravel\Friendship is for normal KoolReport, please use this for Dashboard Framework:

Auto-configure Assets with other MVC Frameworks

Let us know if it works

Newton commented on Mar 27

Thanks! Now it works.

KoolReport commented on Mar 29

Awesome!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

Dashboard