KoolReport's Forum

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

Data Source Not Found - Laravel #601

Closed Craig vc opened this topic on on Jan 21, 2019 - 8 comments

Craig vc commented on Jan 21, 2019

I install koolreport in Laravel using composer I am getting this error now

There is no source available, please add at least one in the settings()

This is my model

<?php

namespace App\Reports;

use Illuminate\Database\Eloquent\Model;



class HiveReport extends \koolreport\KoolReport
{


    // By adding above statement, you have claim the friendship between two frameworks
    // As a result, this report will be able to accessed all databases of Laravel
    // There are no need to define the settings() function anymore
    // while you can do so if you have other datasources rather than those
    // defined in Laravel.


    function setup()
    {
        // Let say, you have "sale_database" is defined in Laravel's database settings.
        // Now you can use that database without any futher setitngs.
        $this->src("mysql")
            ->query("SELECT * FROM users")
            ->pipe($this->dataStore("users"));
    }
}

(I also tried default and the db name)

KoolReport commented on Jan 21, 2019

You need to claim the friendship with Laravel in the report, please refer to this.

Craig vc commented on Jan 21, 2019

I tried that and got this Trait 'koolphp\koolreport\Friendship' not found

KoolReport commented on Jan 21, 2019

Have you download the Laravel package and save to packages folder.

Craig vc commented on Jan 21, 2019

hi yes i used composer to install

KoolReport commented on Jan 21, 2019

The core of KoolReport can be installed through composer, however the package is not. So you just need to download the package,unzip and put "laravel" package inside "koolreport/packages" folder. The laravel package here mean our own package named "laravel" used to support KoolReport to be used inside Laravel framework.

Craig vc commented on Jan 21, 2019

Hi I added that folder to /vendor/koolphp/packages/ bt still get the error - is that the right place?

KoolReport commented on Jan 21, 2019

It should be in "vendor/koolphp/koolreport/packages"

Craig vc commented on Jan 21, 2019

hi sorry that is where it was - my mistake - i had to make the line though use \koolreport\laravel\Friendship;

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
bug
help needed

Laravel