Downloads
Stars
Version
Simple package for displaying read time.
You can install the package via composer:
composer require leepownall/read-time
get()
$readTime = new Pownall\ReadTime\ReadTime('Hello, world!');
$readTime->get();
__toString()
$readTime = new Pownall\ReadTime\ReadTime('Hello, world!');
echo $readTime;
@readtime('Hello, world!')
wordsPerMinute
$readTime = new Pownall\ReadTime\ReadTime('Hello, world!', 300);
@readtime('Hello, world!', 300)
It uses Carbon under the good, specifically forHumans
on the CarbonInterval
.
The output looks like
2 hours 4 minutes
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
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.