KoolReport's Forum

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

Please explain koolreport_assets and how created and maintained #2616

Open James Schlies opened this topic on on Mar 15, 2022 - 5 comments

James Schlies commented on Mar 15, 2022

The documentation reads: "Laravel packages will automatically create a folder name koolreport_assets inside Laravel's public folder in order to hold the report resources such as Javascript files or CSS file."

Can someone further explain the creation, use and maintenance of koolreports_assets?

Also what exactly "automatically" means? Via "composer update"? Via artisan script?

At times the doc mentions the public/koolreports, other times public/koolreports_assets. Is this a typo or are they distinct things. If the latter, may I be pointed to the documentation on creation, use and maintenance of public/koolreports.

What is the meaning of the numbered folders in public/koolreports_assets?

KoolReport commented on Mar 16, 2022

KoolReport and each packages may contains js/css resources that needs to be accessed from browser. Those resources are normally go with packages and many times in inside the "vendor" folder which is prohibited to access. That's why those resources needed to be publish to a public place.

What does it mean by "automatic"? Meaning that you just need to use koolreport without care about the resources. If KoolReport find that resources is prohibited to access, it will try to export resources under a folder name "koolreport_assets".

When you use Laravel package. This package contains the guide for KoolReport to export resources. It tell KoolReport to make a folder "koolreport_assets" under "public" folder of Laravel so that those resources can be accessed. So if you use Laravel package of KoolReport, you do not need to manage the resources.

Those "number" folder is just a random named folder to contains resource of KoolReport's package. You can delete them all and it will be published again when KoolReport need resources.

Beside of "automatically" handle the resources, you can manually handle resource via "assets" in settings()

class MyReport extends KoolReport
{
    protected function settings()
    {
        return [
            "assets"=>[
                "path"=>"../../public/assets",
                "url"=>"/assets"
            ]
        ];
    }
}

The path to let KoolReport knows where to export resources and url to let KoolReport knows how to access them from browser.

Hope my answer helps.

James Schlies commented on Mar 16, 2022

I'm sorry if I'm not clear. Where do the files that "automatically" end up in public/koolreport_assets come from???? If I were to delete the contents of public/koolreport_assets, will it automatically get re-populated? If so, how? Are they re-copied from vendor somehow. Is an api call made to some server someplace to get them???

It sounds like when the folder (indicated by "path" in report class, ie public/koolreport_assets) is missing, it get's created. I get that. Where do the contents of public/koolreports_assets come from.

And could you please let me know where this is covered in the documentation. All I can find is the one sentence I quoted above.

KoolReport commented on Mar 16, 2022

For your questions:

  1. The files populated in koolreport_assets folder comes from koolreport packges in vendor folder.
  2. If you delete contents of koolreport_assets, it will re-populated.
  3. There is mechanism inside KoolReport to detect if there is the lack of resources. If there is, it will populate.
James Schlies commented on Mar 17, 2022

Thanks!!

soumiya commented on Jul 13, 2022

i want api key authentication for creating table not koolreport\table i want url api link

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
None yet

None