{"id":42127659,"url":"https://github.com/paxha/laravel-reportable","last_synced_at":"2026-01-26T15:12:29.956Z","repository":{"id":57036687,"uuid":"230404008","full_name":"paxha/laravel-reportable","owner":"paxha","description":"This Laravel Eloquent extension provides record according to dates using models.","archived":false,"fork":false,"pushed_at":"2020-12-17T16:23:01.000Z","size":14,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T16:55:01.708Z","etag":null,"topics":["laravel","laravel-package","report-generator","reportable","reporting","reports"],"latest_commit_sha":null,"homepage":"","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/paxha.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":"2019-12-27T08:30:12.000Z","updated_at":"2022-02-10T15:23:58.000Z","dependencies_parsed_at":"2022-08-23T20:51:00.530Z","dependency_job_id":null,"html_url":"https://github.com/paxha/laravel-reportable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/paxha/laravel-reportable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paxha%2Flaravel-reportable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paxha%2Flaravel-reportable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paxha%2Flaravel-reportable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paxha%2Flaravel-reportable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paxha","download_url":"https://codeload.github.com/paxha/laravel-reportable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paxha%2Flaravel-reportable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28781308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["laravel","laravel-package","report-generator","reportable","reporting","reports"],"created_at":"2026-01-26T15:12:29.780Z","updated_at":"2026-01-26T15:12:29.948Z","avatar_url":"https://github.com/paxha.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Report Generator\n\n## Introduction\n\nThis Laravel Eloquent extension provides record according to dates using models.\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://travis-ci.org/paxha/laravel-reportable\"\u003e\u003cimg src=\"https://img.shields.io/travis/paxha/laravel-reportable/master.svg?style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.styleci.io/repos/230404008\"\u003e\u003cimg src=\"https://github.styleci.io/repos/230404008/shield?branch=master\" alt=\"StyleCI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/paxha/laravel-reportable\"\u003e\u003cimg src=\"https://poser.pugx.org/paxha/laravel-reportable/d/total.svg?format=flat-square\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/paxha/laravel-reportable\"\u003e\u003cimg src=\"https://poser.pugx.org/paxha/laravel-reportable/v/stable.svg?format=flat-square\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/paxha/laravel-reportable\"\u003e\u003cimg src=\"https://poser.pugx.org/paxha/laravel-reportable/license.svg?format=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\nThis package provides an event that will generate a unique slug when saving or creating any Eloquent model.\n\n## Installation\n\n    composer require paxha/laravel-reportable\n\n## Usage\n\n-   [Getting Started](#getting-started)\n-   [Scopes](#scopes)\n    -   [Yearly Report](#yearly-report)\n    -   [ThisYear Report](#this-year-report)\n    -   [LastYear Report](#last-year-report)\n    -   [Monthly Report](#monthly-report)\n    -   [ThisMonth Report](#this-month-report)\n    -   [LastMonth Report](#last-month-report)\n    -   [This Week Report](#this-week-report)\n    -   [Last Week Report](#last-week-report)\n    -   [Daily Report](#daily-report)\n    -   [Today Report](#today-report)\n    -   [Yesterday Report](#yesterday-report)\n    -   [Hourly Report](#hourly-report)\n-   [Custom Query](#custom-query)\n-   [Advanced Usage](#advanced-usage)\n\n### Getting Started\n\nConsider the following table schema for hierarchical data:\n\n```php\nSchema::create('users', function (Blueprint $table) {\n    $table-\u003eincrements('id');\n    $table-\u003etimestamps();\n});\n```\n\nUse the `Reportable` trait in your model to work with reports:\n\n```php\nclass User extends Model\n{\n    use \\Reportable\\Traits\\Reportable;\n}\n```\n\n### Scopes\n\nThe trait provides query scopes to filter data by datetime:\n\n-   [`yearlyReport($year = null)`](#yearly-report): provide year-wise record. By default it will provide current year record.\n-   [`thisYearReport()`](#this-year-report): provide current year record.\n-   [`lastYearReport()`](#last-year-report): provide previous year record.\n-   [`monthlyReport($month = null, $year = null)`](#monthly-report): provide month-wise record. By default it will provide current month.\n-   [`thisMonthReport()`](#this-month-report): provide current month record.\n-   [`lastMonthReport()`](#last-month-report): provide last month record.\n-   [`thisWeekReport()`](#this-week-report): provide this week record. (mon - sun)\n-   [`lastWeekReport()`](#last-week-report): provide last week record. (mon - sun)\n-   [`dailyReport($date = null)`](#daily-report): provide date-wise record. By default it will provide today's record.\n-   [`todayReport()`](#today-report): provide today record.\n-   [`yesterdayReport()`](#yesterday-report): provide yesterday record.\n-   [`hourlyReport($from = null, $to = null, $date = null)`](#hourly-report): provide hour-wise record. By default it will provide records between last hour to current hour.\n\n#### Yearly Report\n\n```php\n/*Only Current Year Users*/\n$users = User::yearlyReport()-\u003eget();\n\n// or\n\n/*2018 Users*/\n$year = 2018; // or Carbon date\n$users = User::yearlyReport($year)-\u003eget();\n```\n\n#### This Year Report\n\n```php\n/*Only Current Year Users*/\n$users = User::thisYearReport()-\u003eget();\n```\n\n#### Last Year Report\n\n```php\n/*Only Last Year Users*/\n$users = User::lastYearReport()-\u003eget();\n```\n\n#### Monthly Report\n\n```php\n/*Only Current Month Users*/\n$users = User::monthlyReport()-\u003eget();\n\n// or\n\n/*November Current Year Users*/\n$month = 11; // or Carbon date\n$users = User::monthlyReport($month)-\u003eget();\n\n// or\n\n/*November 2018 Year Users*/\n$month = 11; // or Carbon date\n$year = 2018; // or Carbon date\n$users = User::monthlyReport($month, $year)-\u003eget();\n```\n\n#### This Month Report\n\n```php\n/*Only Current Month Users*/\n$users = User::thisMonthReport()-\u003eget();\n```\n\n#### Last Month Report\n\n```php\n/*Only Last Month Users*/\n$users = User::thisMonthReport()-\u003eget();\n```\n\n#### This Week Report\n\n```php\n/*Only Current Week Users (Mon - Sun)*/\n$users = User::thisWeekReport()-\u003eget();\n```\n\n#### Last Week Report\n\n```php\n/*Only Last Week Users (Mon - Sun)*/\n$users = User::lastWeekReport()-\u003eget();\n```\n\n#### Daily Report\n\n```php\n/*Only Today's Users*/\n$users = User::dailyReport()-\u003eget();\n\n// or\n\n/*December 27, 2019 Users*/\n$date = '2019-12-27'; // or Carbon date\n$users = User::dailyReport($date)-\u003eget();\n```\n\n#### Today Report\n\n```php\n/*Only Today's Users*/\n$users = User::todayReport()-\u003eget();\n```\n\n#### Yesterday Report\n\n```php\n/*Only Yesterday's Users*/\n$users = User::yesterdayReport()-\u003eget();\n```\n\n#### Hourly Report\n\n```php\n/*Only Last hour to current hour's Users*/\n$users = User::hourlyReport()-\u003eget();\n\n// or\n\n/*Only 7 am to 2pm Users*/\n\n$from = '07:00'; // or Carbon time\n$to = '14:00'; // or Carbon time\n$users = User::hourlyReport($from, $to)-\u003eget();\n\n// or\n\n/*Only 7 am to 2pm at December 27, 2019 Users*/\n\n$from = '07:00'; // or Carbon time\n$to = '14:00'; // or Carbon time\n$date = '2019-12-27'; // or Carbon date\n$users = User::hourlyReport($from, $to, $date)-\u003eget();\n```\n\n### Custom Query\n\nYou can implement your own conditions or do whatever you want with query.\n\n```php\n$users = User::dailyReport()-\u003ewhere('status', '=', 'inactive')-\u003eget();\n```\n\n### Advanced Usage\n\n```php\n$data = [];\n\n$date = Carbon::now()-\u003efirstOfMonth();\nwhile ($date \u003c= Carbon::now()-\u003eendOfMonth()) {\n    $users = User::dailyReport($date)\n        -\u003ewhen('condition', function ($query) {\n            $query-\u003ewhere('column', 'value');\n        })\n        -\u003ewhereNotIn('column', ['value1', 'value2'])\n        -\u003ewhere('column', 'operator', 'value')\n        -\u003eget();\n\n    $data[] = $users;\n    $date = $date-\u003ecopy()-\u003eaddDay();\n}\n```\n\n## License\n\nThis is open-sourced laravel library licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaxha%2Flaravel-reportable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaxha%2Flaravel-reportable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaxha%2Flaravel-reportable/lists"}