PHP code example of somarkn99 / estimated-reading-time

1. Go to this page and download the library: Download somarkn99/estimated-reading-time library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

somarkn99 / estimated-reading-time example snippets


'providers' => [
    // Other Service Providers
    Somarkn99\EstimatedReadingTime\EstimatedReadingTimeServiceProvider::class,
],

use Somarkn99\EstimatedReadingTime\EstimatedReadingTime;

$readingTime = EstimatedReadingTime::calculate($content, 'en');

Route::prefix('api')->group(function () {
    

return [
    'ar_prefix' => 'الوقت المقدر للقراءة: ',
    'ar_suffix_s' => 'دقيقة',
    'ar_suffix_p' => 'دقائق',
    'en_prefix' => 'Estimated Time of Reading: ',
    'en_suffix' => 'Min',
    'en_wpm' => 300,
    'ar_wpm' => 250,
    'exclude_images' => true,
];
bash
php artisan vendor:publish --provider="Somarkn99\EstimatedReadingTime\EstimatedReadingTimeServiceProvider" --tag="config"
blade
@readingtime($content, 'en')