pownall/read-time

Simple package for displaying read time

Downloads

11

Stars

1

Version

1.0.0

Read Time

Latest Version on Packagist Tests Total Downloads

Simple package for displaying read time.

Installation

You can install the package via composer:

composer require leepownall/read-time

Usage

Using get()

$readTime = new Pownall\ReadTime\ReadTime('Hello, world!');

$readTime->get();

Using __toString()

$readTime = new Pownall\ReadTime\ReadTime('Hello, world!');

echo $readTime;

Using blade directive

@readtime('Hello, world!')

Pass in wordsPerMinute

$readTime = new Pownall\ReadTime\ReadTime('Hello, world!', 300);
@readtime('Hello, world!', 300)

Output

It uses Carbon under the good, specifically forHumans on the CarbonInterval.

The output looks like

2 hours 4 minutes

Config

Default wordsPerMinute is 200. You can override this by passing it in, or publish the config and override there.

php artisan vendor:publish --tag=readtime-config

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

leepownall

Author

leepownall