All Projects → timothepearce → laravel-quasar

timothepearce / laravel-quasar

Licence: MIT license
⏰📊✨Laravel Time Series - Provides an API to create and maintain data projections (statistics, aggregates, etc.) from your Eloquent models, and convert them to time series.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-quasar

eloquence
Eloquence provides a cache on top of Eloquent that prevents multiple models being created for a single database row using the Identity Map design pattern.
Stars: ✭ 18 (-76.92%)
Mutual labels:  eloquent, eloquent-models, eloquent-orm
Elasticquent
Maps Laravel Eloquent models to Elasticsearch types
Stars: ✭ 1,172 (+1402.56%)
Mutual labels:  eloquent, eloquent-models
Eloquentfilter
An Eloquent Way To Filter Laravel Models And Their Relationships
Stars: ✭ 1,113 (+1326.92%)
Mutual labels:  eloquent, eloquent-models
Eloquent Approval
Approval process for Laravel Eloquent models
Stars: ✭ 79 (+1.28%)
Mutual labels:  eloquent, eloquent-models
laravel-nestedupdater
Package for allowing updating of nested Eloquent model relations using a single nested data array.
Stars: ✭ 19 (-75.64%)
Mutual labels:  eloquent, eloquent-models
Laravel Cascade Soft Deletes
Cascading deletes for Eloquent models that implement soft deletes
Stars: ✭ 498 (+538.46%)
Mutual labels:  eloquent, eloquent-models
Laravel Schedulable
Schedule and unschedule eloquent models elegantly without cron jobs
Stars: ✭ 78 (+0%)
Mutual labels:  eloquent, eloquent-models
Plotjuggler
The Time Series Visualization Tool that you deserve.
Stars: ✭ 2,620 (+3258.97%)
Mutual labels:  time-series, plot
Eloquent Relativity
Allows you to decouple your eloquent models from one another.
Stars: ✭ 112 (+43.59%)
Mutual labels:  eloquent, eloquent-models
Searchable
Search/filter functionality for Laravel's Eloquent models
Stars: ✭ 113 (+44.87%)
Mutual labels:  eloquent, eloquent-models
laravel-autonumber
Laravel package to create autonumber for Eloquent model
Stars: ✭ 26 (-66.67%)
Mutual labels:  eloquent, eloquent-models
Eloquent Hashids
On-the-fly hashids for Laravel Eloquent models. (🍰 Easy & ⚡ Fast)
Stars: ✭ 196 (+151.28%)
Mutual labels:  eloquent, eloquent-models
encryptable
Laravel package for persisting encrypted Model properties, providing decryption when accessed.
Stars: ✭ 26 (-66.67%)
Mutual labels:  eloquent, eloquent-models
Laravel Transactional Model Events
Add eloquent model events fired after a transaction is committed or rolled back
Stars: ✭ 52 (-33.33%)
Mutual labels:  eloquent, eloquent-models
inertiajs-tables-laravel-query-builder
Inertia.js Tables for Laravel Query Builder
Stars: ✭ 391 (+401.28%)
Mutual labels:  eloquent, eloquent-models
Laravel Lucene Search
Laravel 4.2, 5.* package for full-text search over Eloquent models based on ZF2 Lucene.
Stars: ✭ 75 (-3.85%)
Mutual labels:  eloquent, eloquent-models
Uplot
📈 A small, fast chart for time series, lines, areas, ohlc & bars
Stars: ✭ 6,808 (+8628.21%)
Mutual labels:  time-series, plot
Covid 19 Germany Gae
COVID-19 statistics for Germany. For states and counties. With time series data. Daily updates. Official RKI numbers.
Stars: ✭ 114 (+46.15%)
Mutual labels:  time-series, timeline
Laravel Nullable Fields
Handles saving empty fields as null for Eloquent models
Stars: ✭ 88 (+12.82%)
Mutual labels:  eloquent, eloquent-models
Laravel Deletable
👾 Gracefully restrict deletion of Laravel Eloquent models
Stars: ✭ 137 (+75.64%)
Mutual labels:  eloquent, eloquent-models

LogoLogo

Latest unstable Version Download count

Build your time series with ease

About

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

Documentation

The full documentation can be found here.

Usage

Installation

composer require timothepearce/laravel-time-series

Migrate the tables

php artisan migrate

Create a Projection

php artisan make:projection MyProjection

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,
    ];
}

Implement a Projection

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

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

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

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].