{"id":20207030,"url":"https://github.com/koolreport/blade","last_synced_at":"2025-04-10T12:33:17.570Z","repository":{"id":57008475,"uuid":"187761532","full_name":"koolreport/blade","owner":"koolreport","description":"Use Blade template engine for KoolReport","archived":false,"fork":false,"pushed_at":"2024-09-20T07:26:41.000Z","size":13,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T11:13:15.863Z","etag":null,"topics":["blade","blade-engine","blade-template","blade-template-engine","mysql-reporting-tools","php-reporting-tools","reporting-engine","template-engine"],"latest_commit_sha":null,"homepage":"https://www.koolreport.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koolreport.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-21T04:28:24.000Z","updated_at":"2024-09-04T09:10:23.000Z","dependencies_parsed_at":"2024-11-14T05:27:20.547Z","dependency_job_id":"dd0f27cf-4945-4b79-8a6c-5796ca023e65","html_url":"https://github.com/koolreport/blade","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"dc2164f094b20beaae270cc8702bed505aee96f0"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fblade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fblade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fblade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fblade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koolreport","download_url":"https://codeload.github.com/koolreport/blade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838443,"owners_count":21004580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blade","blade-engine","blade-template","blade-template-engine","mysql-reporting-tools","php-reporting-tools","reporting-engine","template-engine"],"created_at":"2024-11-14T05:27:14.017Z","updated_at":"2025-04-10T12:33:17.550Z","avatar_url":"https://github.com/koolreport.png","language":"PHP","readme":"# Blade\n\n## Overview\n\nIf you have used Laravel and fell in love with `Blade` template engine then you may use this love template engine with KoolReport. Starting from version 4.0.0, KoolReport supports other template engines rather than just its own template view file.\n\nSo by using `blade` template engine, you can utilize the power of template inheritance such as creating common layout for your report. \n\nBlade does not restrict you from using plain PHP code in your views. In fact, all Blade views are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your report.\n\n## Installation\n\n#### By downloading .zip file\n\n1. [Download](https://www.koolreport.com/packages/blade)\n2. Unzip the zip file\n3. Copy the folder `blade` into `koolreport` folder so that look like below\n\n```bash\nkoolreport\n├── core\n├── blade\n```\n\n#### By composer\n\n```\ncomposer require koolreport/blade\n```\n\n## Get started\n\n__Step 1:__ First you should create two folders, first is `views` to hold the views of your reports, secondly is `cache` folder for blade to generate cache file.\n\n```bash\nproject/\n├── reports/\n│   └── MyReport.php\n├── views/\n│   └── myreport.blade.php\n├── cache/\n```\n\n__Step 2:__ Next, in your `MyReport.php` you initiate blade template like this:\n\n```\nrequire_once \"../../koolreport/core/autoload.php\";\n\nclass MyReport extends \\koolreport\\KoolReport\n{\n    use \\koolreport\\blade\\Engine;\n    \n    protected function bladeInit()\n    {\n        $viewsFolder = __DIR__.\"/../views\";\n        $cacheFolder = __DIR__.\"/../cache\";\n        $blade = new \\Jenssegers\\Blade\\Blade($viewsFolder, $cacheFolder);\n        return $blade;\n    }\n    ...\n\n}\n```\n\n__Step 3:__ Create report's view content. In your `myreport.blade.php` you can do:\n\n```\n\u003chtml\u003e\n\u003chead\u003e\n    \u003ctitle\u003eMyReport\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003c?php\n    \\koolreport\\widgets\\koolphp\\Table::create(array(\n        \"dataSource\"=\u003e$report-\u003edataStore(\"result\"),\n    ));\n    ?\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n__*Important Note*:__ You need to use `$report` variable to refer to the report class, not `$this` as you do when use default Koolreport view file.\n\n__Step 4:__ To make the report run and render, you do:\n\n\n```\n//index.php\n\nrequire_once \"MyReport.php\";\n\n$report = new MyReport;\n$report-\u003erun()-\u003erender(\"myreport\"); // You need to specify the view you want to render\n```\n\nNow your report will run and then use `myreport.blade.php` to render the view of report. \n\n__Congrat!__\n\n\n# Resources\n\n1. [Full documentation](https://www.koolreport.com/docs/blade/overview/)\n2. [Examples \u0026 Demonstration](https://www.koolreport.com/examples)\n\n# Support\n\nPlease use [our forum](https://www.koolreport.com/forum/topics) if you need support, by this way other people can benefit as well. If the support request need privacy, you may send email to us at [support@koolreport.com](mailto:support@koolreport.com).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fblade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoolreport%2Fblade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fblade/lists"}