logiek/laravel-reading-time

This package makes it easy to calculate the estimated reading time for a given piece of content with Laravel.

1.1.0 2023-08-10 17:06 UTC

This package is auto-updated.

Last update: 2024-11-10 19:47:32 UTC


README

Latest Stable Version Total Downloads License PHP Version Require

This package makes it easy to calculate the estimated reading time for a given piece of content with Laravel.

Installation

You can install the package via Composer:

composer require logiek/laravel-reading-time

The package will automatically register itself. Optionally you can publish the config file with:

php artisan vendor:publish --provider="Logiek\ReadingTime\ReadingTimeServiceProvider" --tag="config"

Usage

use Logiek\ReadingTime\ReadingTime;

echo (new ReadingTime())->slow('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');

// Using the container
echo app(ReadingTime::class)->average('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');

// Using the helper
echo reading_time()->fast('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'); 
echo reading_time('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');

Changelog

Please see the CHANGELOG for more information about recent changes.

License

This project is open-sourced software licensed under the MIT license.