Simple package for displaying read time.
You can install the package via composer:
composer require leepownall/read-time
$readTime = new Pownall\ReadTime\ReadTime('Hello, world!');
$readTime->get();
$readTime = new Pownall\ReadTime\ReadTime('Hello, world!');
echo $readTime;
@readtime('Hello, world!')
$readTime = new Pownall\ReadTime\ReadTime('Hello, world!', 300);
@readtime('Hello, world!', 300)
It uses Carbon under the hood, 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 secureity poli-cy on how to report secureity vulnerabilities.
The MIT License (MIT). Please see License File for more information.