Download the PHP package davealex/laravel-time-period-reference without Composer
On this page you can find all versions of the php package davealex/laravel-time-period-reference. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davealex/laravel-time-period-reference
More information about davealex/laravel-time-period-reference
Files in davealex/laravel-time-period-reference
Package laravel-time-period-reference
Short Description A service for processing string-based time references into carbon instances
License MIT
Homepage https://github.com/davealex/laravel-time-period-reference
Informations about the package laravel-time-period-reference
Laravel Time Period Reference
This Laravel package provides a simple way to convert time period references (e.g., "2 days", "1 week") into Carbon
instances.
Installation
You can install the package via composer:
Configuration
Publish the configuration file to customize the time units and their corresponding time references:
Example configuration
Usage
Use the LaravelTimePeriodReference class to convert time period references into Carbon instances.
Exceptions
The package throws Davealex\LaravelTimePeriodReference\Exceptions\InvalidTimeReferenceCarbonInstance
in the following cases:
- Invalid time reference format (e.g., non-numeric value before unit).
- Unknown time unit.
- Error during Carbon instance creation.
Testing
To run the tests, use PHPUnit:
or
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please feel free to contribute by submitting issues or pull requests.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
This package is open-source and available under the MIT license.