PHPackages                             jaktech/anaphora - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. jaktech/anaphora

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

jaktech/anaphora
================

Anaphora is a robust Laravel reporting package that simplifies the generation and retrieval of insightful reports. With Anaphora, effortlessly create, manage, and retrieve reports for your Laravel applications, providing a streamlined experience for tracking, analyzing, and visualizing essential data. Harness the power of Anaphora to enhance your reporting capabilities and make informed decisions based on comprehensive and organized data insights.

v0.1.1(2y ago)07MITPHPPHP ^7.2|~8.0.0|~8.1.0|~8.2.0

Since Nov 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Atlasoties/anaphora)[ Packagist](https://packagist.org/packages/jaktech/anaphora)[ RSS](/packages/jaktech-anaphora/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel Report Generator
========================

[](#laravel-report-generator)

Introduction
------------

[](#introduction)

This Laravel Eloquent extension provides record according to dates using models.

[![Latest Stable Version](https://camo.githubusercontent.com/624108a45bde1aad1965440cee1d9c9033e9b48e91039c969281bda24bfd4e0a/68747470733a2f2f706f7365722e707567782e6f72672f6a616b746563682f616e6170686f72612f76)](https://packagist.org/packages/jaktech/anaphora)[![Total Downloads](https://camo.githubusercontent.com/b697f38e1bd82a8e9139526b105b45988a8053a47d403af391ff0c83797464b3/68747470733a2f2f706f7365722e707567782e6f72672f6a616b746563682f616e6170686f72612f646f776e6c6f616473)](https://packagist.org/packages/jaktech/anaphora)[![License](https://camo.githubusercontent.com/3ecfc40f0c76c14684037d46f323babb5d7e5bd7e72d81554b5a1c16b9e581c6/68747470733a2f2f706f7365722e707567782e6f72672f6a616b746563682f616e6170686f72612f6c6963656e7365)](https://packagist.org/packages/jaktech/anaphora)

This package provides an event that will generate a unique slug when saving or creating any Eloquent model.

Installation
------------

[](#installation)

```
composer require jaktech/anaphora

```

Usage
-----

[](#usage)

- [Getting Started](#getting-started)
- [Scopes](#scopes)
    - [Yearly Report](#yearly-report)
    - [ThisYear Report](#this-year-report)
    - [LastYear Report](#last-year-report)
    - [Monthly Report](#monthly-report)
    - [ThisMonth Report](#this-month-report)
    - [LastMonth Report](#last-month-report)
    - [This Week Report](#this-week-report)
    - [Last Week Report](#last-week-report)
    - [Daily Report](#daily-report)
    - [Today Report](#today-report)
    - [Yesterday Report](#yesterday-report)
    - [Hourly Report](#hourly-report)
- [Custom Query](#custom-query)
- [Advanced Usage](#advanced-usage)

### Getting Started

[](#getting-started)

Consider the following table schema for hierarchical data:

```
Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->timestamps();
});
```

Use the `Reportable` trait in your model to work with reports:

```
class User extends Model
{
    use \Jakteck\Anaphora\Traits\Reportable;
}
```

### Scopes

[](#scopes)

The trait provides query scopes to filter data by datetime:

- [`yearlyReport($year = null)`](#yearly-report): provide year-wise record. By default it will provide current year record.
- [`thisYearReport()`](#this-year-report): provide current year record.
- [`lastYearReport()`](#last-year-report): provide previous year record.
- [`monthlyReport($month = null, $year = null)`](#monthly-report): provide month-wise record. By default it will provide current month.
- [`thisMonthReport()`](#this-month-report): provide current month record.
- [`lastMonthReport()`](#last-month-report): provide last month record.
- [`thisWeekReport()`](#this-week-report): provide this week record. (mon - sun)
- [`lastWeekReport()`](#last-week-report): provide last week record. (mon - sun)
- [`dailyReport($date = null)`](#daily-report): provide date-wise record. By default it will provide today's record.
- [`todayReport()`](#today-report): provide today record.
- [`yesterdayReport()`](#yesterday-report): provide yesterday record.
- [`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.

#### Yearly Report

[](#yearly-report)

```
/*Only Current Year Users*/
$users = User::yearlyReport()->get();

// or

/*2018 Users*/
$year = 2018; // or Carbon date
$users = User::yearlyReport($year)->get();
```

#### This Year Report

[](#this-year-report)

```
/*Only Current Year Users*/
$users = User::thisYearReport()->get();
```

#### Last Year Report

[](#last-year-report)

```
/*Only Last Year Users*/
$users = User::lastYearReport()->get();
```

#### Monthly Report

[](#monthly-report)

```
/*Only Current Month Users*/
$users = User::monthlyReport()->get();

// or

/*November Current Year Users*/
$month = 11; // or Carbon date
$users = User::monthlyReport($month)->get();

// or

/*November 2018 Year Users*/
$month = 11; // or Carbon date
$year = 2018; // or Carbon date
$users = User::monthlyReport($month, $year)->get();
```

#### This Month Report

[](#this-month-report)

```
/*Only Current Month Users*/
$users = User::thisMonthReport()->get();
```

#### Last Month Report

[](#last-month-report)

```
/*Only Last Month Users*/
$users = User::thisMonthReport()->get();
```

#### This Week Report

[](#this-week-report)

```
/*Only Current Week Users (Mon - Sun)*/
$users = User::thisWeekReport()->get();
```

#### Last Week Report

[](#last-week-report)

```
/*Only Last Week Users (Mon - Sun)*/
$users = User::lastWeekReport()->get();
```

#### Daily Report

[](#daily-report)

```
/*Only Today's Users*/
$users = User::dailyReport()->get();

// or

/*December 27, 2019 Users*/
$date = '2019-12-27'; // or Carbon date
$users = User::dailyReport($date)->get();
```

#### Today Report

[](#today-report)

```
/*Only Today's Users*/
$users = User::todayReport()->get();
```

#### Yesterday Report

[](#yesterday-report)

```
/*Only Yesterday's Users*/
$users = User::yesterdayReport()->get();
```

#### Hourly Report

[](#hourly-report)

```
/*Only Last hour to current hour's Users*/
$users = User::hourlyReport()->get();

// or

/*Only 7 am to 2pm Users*/

$from = '07:00'; // or Carbon time
$to = '14:00'; // or Carbon time
$users = User::hourlyReport($from, $to)->get();

// or

/*Only 7 am to 2pm at December 27, 2019 Users*/

$from = '07:00'; // or Carbon time
$to = '14:00'; // or Carbon time
$date = '2019-12-27'; // or Carbon date
$users = User::hourlyReport($from, $to, $date)->get();
```

### Custom Query

[](#custom-query)

You can implement your own conditions or do whatever you want with query.

```
$users = User::dailyReport()->where('status', '=', 'inactive')->get();
```

### Advanced Usage

[](#advanced-usage)

```
$data = [];

$date = Carbon::now()->firstOfMonth();
while ($date endOfMonth()) {
    $users = User::dailyReport($date)
        ->when('condition', function ($query) {
            $query->where('column', 'value');
        })
        ->whereNotIn('column', ['value1', 'value2'])
        ->where('column', 'operator', 'value')
        ->get();

    $data[] = $users;
    $date = $date->copy()->addDay();
}
```

License
-------

[](#license)

This is open-sourced laravel library licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

905d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85f12732d7bca4fc18b802011f1e7b8a077f9d16e3e792f5aab0110c08ffb51f?d=identicon)[Atlasoties](/maintainers/Atlasoties)

---

Top Contributors

[![atlasoties](https://avatars.githubusercontent.com/u/64778524?v=4)](https://github.com/atlasoties "atlasoties (5 commits)")

---

Tags

laravelreportEthiopiaanaphora

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaktech-anaphora/health.svg)

```
[![Health](https://phpackages.com/badges/jaktech-anaphora/health.svg)](https://phpackages.com/packages/jaktech-anaphora)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[jimmyjs/laravel-report-generator

Rapidly Generate Simple Pdf &amp; Excel Report on Laravel 5 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy &amp; maatwebsite/excel)

580157.4k1](/packages/jimmyjs-laravel-report-generator)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[ghanem/reportable

Reportable Polymorphic Eloquent Models for Laravel 6, 7, 8, 9, 10, 11 &amp; 12

347.6k](/packages/ghanem-reportable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
