PHPackages                             timothepearce/laravel-quasar - 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. [Database &amp; ORM](/categories/database)
4. /
5. timothepearce/laravel-quasar

Abandoned → [timothepearce/laravel-time-series](/?search=timothepearce%2Flaravel-time-series)Library[Database &amp; ORM](/categories/database)

timothepearce/laravel-quasar
============================

Laravel Time Series provides an API to create and maintain projected data from you Eloquent models, and represent them as time-series.

v1.0.0-beta-9(4y ago)965510[1 issues](https://github.com/timothepearce/laravel-time-series/issues)MITPHPPHP ^8.0CI passing

Since Nov 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/timothepearce/laravel-time-series)[ Packagist](https://packagist.org/packages/timothepearce/laravel-quasar)[ Docs](https://github.com/timothepearce/laravel-time-series)[ GitHub Sponsors](https://github.com/TimothePearce)[ RSS](/packages/timothepearce-laravel-quasar/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (7)Dependencies (9)Versions (14)Used By (0)

[![Logo](./static/logo.svg#gh-light-mode-only)](./static/logo.svg#gh-light-mode-only)[![Logo](./static/logo_white.svg#gh-dark-mode-only)](./static/logo_white.svg#gh-dark-mode-only)

[ ![Latest unstable Version](https://camo.githubusercontent.com/f454cbd7f1f0fe124a0c958bb8f076d600fcbd5a291eca53acc7c6949c58062a/687474703a2f2f706f7365722e707567782e6f72672f74696d6f7468657065617263652f6c61726176656c2d74696d652d7365726965732f762f756e737461626c65)](https://packagist.org/packages/timothepearce/laravel-time-series)[ ![Download count](https://camo.githubusercontent.com/48d34e563761189ed57b727560fbcba87729c93e05f53cc282c0aaa4593a1c73/687474703a2f2f706f7365722e707567782e6f72672f74696d6f7468657065617263652f6c61726176656c2d74696d652d7365726965732f646f776e6c6f616473)](https://packagist.org/packages/timothepearce/laravel-time-series)[ ![](https://github.com/timothepearce/laravel-time-series/actions/workflows/run-tests.yml/badge.svg)](https://github.com/timothepearce/laravel-time-series/actions/workflows/run-tests.yml)

Build your time series with ease

About
-----

[](#about)

Laravel Time Series provides an API to projects data from your Eloquent models, and convert them to time series.

Documentation
-------------

[](#documentation)

The full documentation can be found [here](https://timothepearce.github.io/laravel-time-series-docs).

Usage
-----

[](#usage)

### Installation

[](#installation)

```
composer require timothepearce/laravel-time-series
```

### Migrate the tables

[](#migrate-the-tables)

```
php artisan migrate
```

### Create a Projection

[](#create-a-projection)

```
php artisan make:projection MyProjection
```

### Make a model projectable

[](#make-a-model-projectable)

When you want to make your model projectable, you must add it the `Projectable` trait and define the `$projections` class attribute:

```
use App\Models\Projections\MyProjection;
use TimothePearce\TimeSeries\Projectable;

class MyProjectableModel extends Model
{
    use Projectable;

    protected array $projections = [
        MyProjection::class,
    ];
}
```

If you want to use a different date field from your Model instead of created\_at then do the following :

1. Make sure the field is casted to Carbon

```
use App\Models\Projections\MyProjection;
use TimothePearce\TimeSeries\Projectable;

class MyProjectableModel extends Model
{
    use Projectable;

    protected $casts = [
        'other_date_time' => 'datetime:Y-m-d H:00',
    ];

    protected array $projections = [
        MyProjection::class,
    ];
}
```

2. Add the dateColumn field in your Projection

```
namespace App\Models\Projections;

use Illuminate\Database\Eloquent\Model;
use TimothePearce\TimeSeries\Contracts\ProjectionContract;
use TimothePearce\TimeSeries\Models\Projection;

class MyProjection extends Projection implements ProjectionContract
{
    /**
     * The projected periods.
     */
    public array $periods = [];

    public string $dateColumn = 'other_date_time';
....
```

### Implement a Projection

[](#implement-a-projection)

When you're implementing a projection, follow theses three steps:

- [Define your projection periods](https://timothepearce.github.io/laravel-time-series-docs/getting-started/implement-a-projection#define-your-projection-periods)
- [Add a default content](https://timothepearce.github.io/laravel-time-series-docs/getting-started/implement-a-projection#define-the-default-content-of-your-projection)
- [Bind your projection to the projectable models](https://timothepearce.github.io/laravel-time-series-docs/getting-started/implement-a-projection#implement-the-binding)

### Query a Projection

[](#query-a-projection)

A Projection is an Eloquent model and is queried the same way, but keep in mind that the projections are all stored in a single table. That means you'll have to use scope methods to get the correct projections regarding the period you defined earlier:

```
MyProjection::period('1 day')
    ->between(
        today()->subDay(), // start date
        today(), // end date
    )
    ->get();
```

### Query a time series

[](#query-a-time-series)

To get a time series from a projection model, use the toTimeSeries method:

```
MyProjection::period('1 day')
    ->toTimeSeries(
        today()->subDay(),
        today(),
    );
```

Note that this method **fill the missing projections between the given dates** with the default content you defined earlier.

Credits
-------

[](#credits)

- [Timothé Pearce](https://github.com/timothepearce)
- [All contributors](https://github.com/timothepearce/laravel-time-series/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.4% 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 ~10 days

Total

10

Last Release

1536d ago

Major Versions

v0.1-beta → v1.0.0-beta-12021-12-29

PHP version history (2 changes)v0.1-betaPHP ^8.0

v1.0.0-beta-2PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0aa1d0c6f1ae65696ad52c2baa59447effdf8b512a9c5577885d5d3bba7bae1?d=identicon)[TimothePearce](/maintainers/TimothePearce)

---

Top Contributors

[![timothepearce](https://avatars.githubusercontent.com/u/11693661?v=4)](https://github.com/timothepearce "timothepearce (329 commits)")[![drsdre](https://avatars.githubusercontent.com/u/809827?v=4)](https://github.com/drsdre "drsdre (6 commits)")[![salhdev](https://avatars.githubusercontent.com/u/16446153?v=4)](https://github.com/salhdev "salhdev (6 commits)")[![ordago](https://avatars.githubusercontent.com/u/6376814?v=4)](https://github.com/ordago "ordago (2 commits)")[![rettigd](https://avatars.githubusercontent.com/u/875977?v=4)](https://github.com/rettigd "rettigd (1 commits)")[![tinsaeDev](https://avatars.githubusercontent.com/u/28869217?v=4)](https://github.com/tinsaeDev "tinsaeDev (1 commits)")

---

Tags

aggregatorcharteloquenteloquent-modelseloquent-ormlaravelphpplotprojectionprojectionsstatisticstime-seriestimelinelaravelstatsstatisticsprojectorstime seriesprojectionsaggregatorLaravelTimeSerieslaravel-time-series

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timothepearce-laravel-quasar/health.svg)

```
[![Health](https://phpackages.com/badges/timothepearce-laravel-quasar/health.svg)](https://phpackages.com/packages/timothepearce-laravel-quasar)
```

###  Alternatives

[timothepearce/laravel-time-series

Laravel Time Series provides an API to create and maintain projected data from you Eloquent models, and represent them as time-series.

955.4k](/packages/timothepearce-laravel-time-series)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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