{"id":17180431,"url":"https://github.com/agoalofalife/reports","last_synced_at":"2025-07-16T23:35:30.010Z","repository":{"id":56942109,"uuid":"123920411","full_name":"agoalofalife/reports","owner":"agoalofalife","description":"UI for created and download reports in Laravel","archived":false,"fork":false,"pushed_at":"2019-05-13T09:40:18.000Z","size":1670,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T11:17:49.618Z","etag":null,"topics":["cron","laravel","laravel-package","notifications","report","reports"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agoalofalife.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-05T13:03:33.000Z","updated_at":"2023-06-22T11:08:31.000Z","dependencies_parsed_at":"2022-08-21T02:10:24.623Z","dependency_job_id":null,"html_url":"https://github.com/agoalofalife/reports","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/agoalofalife/reports","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Freports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Freports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Freports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Freports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agoalofalife","download_url":"https://codeload.github.com/agoalofalife/reports/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Freports/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263917536,"owners_count":23529603,"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":["cron","laravel","laravel-package","notifications","report","reports"],"created_at":"2024-10-15T00:29:36.499Z","updated_at":"2025-07-06T14:33:22.112Z","avatar_url":"https://github.com/agoalofalife.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003eREPORTS\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://scrutinizer-ci.com/g/agoalofalife/reports/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/agoalofalife/reports/badges/quality-score.png?b=master\"\u003e\u003c/a\u003e\n \u003ca href=\"https://scrutinizer-ci.com/g/agoalofalife/reports/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/agoalofalife/reports/badges/coverage.png?b=master\"\u003e\u003c/a\u003e\n \u003ca href=\"https://scrutinizer-ci.com/g/agoalofalife/reports/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/agoalofalife/reports/badges/build.png?b=master\"\u003e\u003c/a\u003e\n \u003c/p\u003e\n \n\u003cp align=\"center\"\u003e\u003cimg src=\"/docs/images/base.jpg\"\u003e\u003c/p\u003e\n\n\n\u003e Requirements :\nPHP verison \u003e= 7.1.0\nLaravel version \u003e= 5.5\n\n```\nnot support Laravel version 5.8 \u0026 \u003e\n```\n### What is it?\n\nThis is package offers ready UI and some code, for reports. \n\nReports will be with extensions: `pdf, xlxs, xls, csv` .\n\nIn the paradigm Laravel, we make reprots and write code. It's just!\n\n### Install\n\n```php\ncomposer require agoalofalife/reports\n```\n\n```php\nphp artisan reports:install\n```\n\n### Locale\n\nIn file `config/app.php` select your language.\n\nThe package provides two languages:\n- ru\n- en\n\n### Blade and UI\n\nIn your template, you need to paste the code\n\n```php\n  \u003cbody\u003e\n    @include('reports::app')\n    ...\n```\n\n### Cron\nYou have to add cron, how separete process.\n\n```php\n// App\\Console\\Kernel\nuse agoalofalife\\Reports\\Console\\ParseReportsCommand;\n\n  $schedule-\u003ecommand(ParseReportsCommand::class)-\u003eeveryMinute();\n```\n\n### The development process\n\nYou create new file report:\n\n```php\nphp artisan make:report NameReport\n```\nInsert in config `config/reports.php` :\n```php\n\n  'reports' =\u003e [\n          \\App\\Reports\\TestReport::class\n    ],\n```\n\nFill the class:\n```php\n\u003c?php\ndeclare(strict_types=1);\nnamespace App\\Reports;\n\nuse agoalofalife\\Reports\\Contracts\\HandlerReport;\nuse agoalofalife\\Reports\\Report;\n\nclass TestReport extends Report implements HandlerReport\n{\n    /**\n     * Disk for filesystem\n     * @var string\n     */\n    public $disk = 'public';\n\n  /**\n     * Format export : xls, xlsx, pdf, csv\n     * @var string\n     */\n    public $extension = 'xlsx';\n\n     /**\n     * Get file name\n     * @return string\n     */\n    public function getFilename() : string\n    {\n        return 'TestReport';\n    }\n\n    /**\n     * Get title report\n     * @return string\n     */\n    public function getTitle() : string\n    {\n        return 'Test';\n    }\n\n    /**\n     * Get description report\n     * @return string\n     */\n    public function getDescription() : string\n    {\n        return 'Description test report';\n    }\n\n    /**\n     * @param $excel\n     * @return bool\n     */\n    public function handler($excel) : bool\n    {\n      $excel-\u003esheet('Sheetname', function ($sheet) {\n            $sheet-\u003erows(array(\n                array('test1', 'test2'),\n                array('test3', 'test4')\n            ));\n        });\n      return true;\n    }\n}\n```\nProperty `$disk`, name disk in filesystem.\n\nProperty `$extension`, type extension your file.\n\nMethod `getFilename` accordingly return name file.\n\nMethod `getTitle` return name title in UI.\n\nMethod `getDescription` return description in UI.\n\nMethod `handler` is base method. Package use [external](https://github.com/Maatwebsite/Laravel-Excel) package.\n\nMethod is a small wrapper.\n\n\n### Notification\n\nOnce the report is ready, you can send [notification](https://laravel.com/docs/5.5/notifications).\n\nFor this you need to implement interface `agoalofalife\\Reports\\Contracts\\NotificationReport`.\n\nMethod `getNotifiable` return `notifiable`, which has a method `routeNotificationFor`.\n\nAnd method `getNotification`, return `Notification` type.\n```php\n    // implements agoalofalife\\Reports\\Contracts\\NotificationReport\n    public function getNotifiable()\n    {\n        return User::where('email', 'test@gmail.com')-\u003eget()-\u003efirst();\n    }\n\n    public function getNotification(): Notification\n    {\n        return new InvoicePaid();\n    }\n```\n```php\n// app/User.php\n\n    public function routeNotificationForSlack($notification)\n    {\n        return 'hook';\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoalofalife%2Freports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagoalofalife%2Freports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoalofalife%2Freports/lists"}