Download the PHP package somarkn99/estimated-reading-time without Composer
On this page you can find all versions of the php package somarkn99/estimated-reading-time. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download somarkn99/estimated-reading-time
More information about somarkn99/estimated-reading-time
Files in somarkn99/estimated-reading-time
Package estimated-reading-time
Short Description A simple package to calculate and display estimated reading time in both Arabic and English.
License MIT
Informations about the package estimated-reading-time
Estimated Reading Time
This package provides a simple way to calculate and display the estimated reading time for content in both Arabic and English.
Installation
You can install the package via composer:
A Wordpress version of this package is available as a plugin here
Usage
Service Provider
Add the service provider to the providers
array in config/app.php
:
Configuration
You can publish the configuration file using this command:
This will publish the estimatedreadingtime.php
configuration file to the config
directory.
Blade Directive
You can use the Blade directive to display the estimated reading time in your views:
Or for Arabic content:
Directly Using the Main Class
You can directly call the calculate
method from the EstimatedReadingTime
class in your controllers, commands, or other parts of your application:
API Usage
If you prefer to use an API to get the estimated reading time, you can use the provided endpoint.
Define the Route
Ensure the route is loaded by including it in your routes/api.php
:
Make a Request
Send a POST
request to /api/reading-time
with the content and language in the request body.
Request:
Response:
Configuration Options
You can customize the package by modifying the configuration options:
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Somar Kesen
- Abdoo Mayhob
- All Contributors
License
The MIT License (MIT). Please see License File for more information.