Download the PHP package boysfromthefactory/groundhog without Composer

On this page you can find all versions of the php package boysfromthefactory/groundhog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package groundhog

Groundhog

Declarative recurring Eloquent models backed by RFC 5545 rules.

Add one trait to a model, give a record a recurrence rule, and keep querying it like any other model: every read returns one hydrated, non-stored instance per occurrence, next to your plain records. Pagination, counts, aggregates, ordering, whereHas, joins and eager loading all work over the occurrences. Saving an occurrence stores it as an exception of its series; deleting one cancels it.

Rules are parsed and expanded by rlanvin/php-rrule.

Documentation

The full guide, with examples for every feature, is in the wiki: Quick Start · Usage guide · Configuration · Errors · Limitations

Requirements

Installation

Optionally publish the configuration:

The migration creates two tables: groundhog_recurrences (one rule per series) and groundhog_exclusions (exceptions and cancellations). Occurrences are generated per query and never stored. Your own tables need no new columns.

Upgrading from 0.1: run php artisan vendor:publish --tag="groundhog-migrations" and php artisan migrate again. The newly published migration drops the groundhog_occurrences table and the materialized_until column.

Declaring a recurring model

List recurrence_rule in $fillable if the model uses $fillable; $guarded models accept it as is.

Assigning rules

A rule is attached through the recurrence_rule attribute and saved with the record:

The rule may be an RRULE string, a string with a DTSTART;TZID=… line, a php-rrule parts array (['FREQ' => 'WEEKLY', 'BYDAY' => 'MO']) or an RRule\RRule. All RFC 5545 RRULE components are supported. The first occurrence and the duration of every occurrence always come from the record's own start and end; a DTSTART in the input only contributes its time zone. Occurrences keep their local wall-clock time across daylight-saving changes in that zone.

Invalid input throws InvalidRecurrenceRule naming the offending part as soon as it is assigned. EXDATE, RDATE and EXRULE are rejected: exclusions come from cancelling or editing occurrences. Assign null to turn a series back into a plain record.

The rule cast

$meeting->recurrence_rule returns an RRule\RRule, so every php-rrule method works:

It reflects the rule only; cancellations and exceptions are not applied to it.

Querying

Write queries as for any model:

Each occurrence carries the series' attributes with its own start and end, reports exists === false, has no primary key, and exposes:

An occurrence is addressed by groundhog_series_key plus groundhog_original_starts_at; both are present on every row (null for plain records) and serialised by toArray().

A rule without COUNT or UNTIL never ends, so a query without an upper bound on the start or end column expands it up to the configured horizon after its lower bound, or after now.

Editing, cancelling and deleting

save(), update(), increment() and decrement() on an occurrence persist it as an exception, even without changes, and fire the usual creating/created/saved events. Hard-deleting an exception keeps its occurrence cancelled; soft-deleting it hides it until restore().

Editing the series record changes every occurrence that has no exception. Changing its rule or its start detaches its exceptions as plain records and discards its cancellations; changing only its end, or assigning the identical rule, keeps both. Deleting a series removes its rule, occurrences and exceptions; soft-deleting it hides them until restore().

Caveats

Testing

Changelog

See CHANGELOG.

License

The MIT License (MIT). See License File.


All versions of groundhog with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/contracts Version ^13.0
rlanvin/php-rrule Version ^3.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package boysfromthefactory/groundhog contains the following files

Loading the files please wait ...