KoolReport's Forum

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

Koolreports Dashboard with Laravel 9 #2596

Closed barlas opened this topic on on Feb 25, 2022 - 4 comments

barlas commented on Feb 25, 2022

Hey,

I am trying to use koolreports dashboard with Laravel 9.2. I have followed the quick start guide, but I get the error "The application encountered an unexpected condition that prevented it from fulfilling your request".

After some debugging it seems, when \koolreports\dashboard\Application tries to load file \koolreports\dashboard\View, composer can't find it. The file exists, but for some reason composer can't load it.

I have tried creating a normal report in Laravel, and it loads fine. Problem is only with dashboard.

Any suggestions?

I am using: - PHP: 8.1 - Laravel: 9.2 - koolreport/dashboad 3.2.4 - koolreport/pro 5.9 - koolreport/core 5.5

KoolReport commented on Mar 3, 2022

We are sorry for the late reply. Could you please give us a screenshoot of the issue, if you could provide a little of source-code, it would be great.

barlas commented on Mar 3, 2022

No worries. And thanks for the reply.

It started working now...

I had Laravel friendship trait added to 'PaymentTable.php', event though I later tried using Automaker class as instructed in the guide, but I hadn't removed the trait. I removed friendship trait to clean the code before sharing and it started working. So, seems like some conflict with friendship trait with something in Dashboard?

BTW it's showing the page, but it's not loading any JS or CSS file. I tried downloading the quick start zip and used it without any framework (just composer install), and it is same.

And here's the source:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="KoolReport.com">
    <meta name="keywords" content="">
        <title>Dashboard</title>
</head>
<body>
            <div id="Main" class="app header-fixed sidebar-fixed">
    <header class="app-header navbar">
    <button class="navbar-toggler mobile-sidebar-toggler d-lg-none" type="button">
    <span class="navbar-toggler-icon"></span>
    </button>
    <a onClick="loadDashboard('PaymentBoard')" href="javascript: void 0" class="navbar-brand text-center" style="color:#fff;background-image:none;padding-top:10px" href="#">
        <strong>Dashboard</strong>    </a>
    <button class="navbar-toggler sidebar-toggler d-md-down-none" type="button">
        <span class="navbar-toggler-icon"></span>
    </button>
    <ul class="nav navbar-nav d-md-down-none mr-auto">
            </ul>
    <ul class="nav navbar-nav ml-auto">
            </ul>
</header>    <div class="app-body">
        <div class="sidebar">
    <nav class="sidebar-nav">
        <ul class="nav">
        <li class="nav-item">
    <a data-path="[&quot;Payments Board&quot;]" class="nav-link" onClick="navMove(this)" href="javascript:void 0" data-name="PaymentBoard">
        <i class="icon-doc"></i>Payments Board            </a>
</li>        </ul>
    </nav>
    <span class="sidebar-foot"></span>
</div>        <main class="main">
            <ol id="Main_Breadcrumb" class="breadcrumb"></ol>
            <div class="container-fluid app-container pb-2">
                <dashboard name="PaymentBoard">

    <script type="text/javascript">
        KoolReport.dashboard.dboard.start("PaymentBoard","Payments Board");
        KoolReport.dashboard.dboard.setState({});
        KoolReport.dashboard.headerTitle("Payments Board - Dashboard");
    </script>
    
KoolReport commented on Mar 3, 2022

This is the html source-code from browser which is not what I want. Please share the php code.

Let try this. Inside the App.php, you use this:

class App extends Application
{
    use \koolreport\dashboard\inside\Laravel;
    ...
}

Let me know if it works.

barlas commented on Mar 4, 2022

Sorry for the confusion.

My original issue was fixed when I removed the Laravel friendship trait.

I have another issue, but I'll open a separate topic for that.

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