0

I am using KoolReport Laravel page to generate report.

Koolreport has DataTables class but when i use it i got the error :

Class 'DataTables' not found (View: C:\xampp\htdocs\invoice\resources\views\reports\report.blade.php)

My code :

    <html>
    <head>
        <title>My Report</title>
    </head>
    <body>
    <h1>It works</h1>
    <?php
    DataTables::create([
        "dataSource"=>$this->dataStore("users"),
        "options"=>array(
            "paging"=>true
        )
    ]);
    ?>
    </body>
    </html>

2 Answers 2

1

Please include Datatable declaration as below in your Controller file.

<?php
use \koolreport\datagrid\DataTables;
?>

Or as an alternative, you can directly specify full path in blade file.

 \koolreport\datagrid\DataTables::create([
        "dataSource"=>$this->dataStore("users"),
        "options"=>array(
            "paging"=>true
        )
    ]);

Reference links :

KoolReport datatables

KoolReport Blade

Sign up to request clarification or add additional context in comments.

Comments

1

Try to use '\'

@php
\DataTables::create([
    "dataSource"=>$this->dataStore("users"),
    "options"=>array(
        "paging"=>true
    )
]);
@endphp

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.