Skip to content
Laravel Packagev13.xMIT License92.3K+ downloads

Readable: Raw values, human words

Readable numbers, dates and sizes in Laravel, zero setup. Print 77.7K, 1.5 KB or 3 months 29 minutes with @readableCompactNumber, @readableFileSize and @readableDuration.

$composer require pharaonic/laravel-readable

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.0 Oct 11, 20268.3 – 8.513Current Docs: Read the v13.x docs
v12.xv12.0.0 Oct 11, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.0 Oct 11, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.0 Oct 11, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.0 Oct 11, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.0 Oct 11, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.0 Oct 11, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.0 Oct 11, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.0
Oct 11, 2026 (1 month ago)
Released lines
8
documented lines with a release; see compatibility
CI on main
Not available right now
GitHub Actions status

From the package's releases and its GitHub Actions. A passing run means the test suite passed on main, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

Every formatter is a Blade directive, a global helper and a static method.

resources/views/files/show.blade.php
1<h1>{{ $file->name }}</h1>
2 
3<p>Size: @readableFileSize($file->size)</p> {{-- 1.5 KB --}}
4<p>Downloads: @readableCompactNumber($file->downloads)</p> {{-- 77K --}}
5<p>Uploaded: @readableDate($file->created_at)</p> {{-- 24 April 2020 --}}
6<p>@readableRelativeDateTime($file->updated_at)</p> {{-- 2 hours before --}}
7 
8{{-- Or in PHP --}}
9{{ readable_file_size($file->size, false) }} {{-- 1.46 KiB --}}
Key Features

Everything you need to print values for humans

No configuration. Call a method, a helper or a Blade directive.

Numbers

Group thousands (10,203,040), shorten (77.7K), keep decimals only when they matter (70, 70.07).

Numbers in Words

7721 becomes seven thousand seven hundred twenty-one, in English without intl or any language with it.

Dates & Times

24 April 2020, 03:20 PM or Friday, April 24, 2020 05:20 PM, in any timezone.

Differences

29 years before, or the full 29 years 2 months 3 days ... between any two dates.

File Sizes

Decimal (1.5 KB) or binary (7 KiB) units, from bytes up to yottabytes.

Three Ways to Call

Readable::getFileSize(), readable_file_size() or @readableFileSize(), with the same arguments.

FAQ

Readable Questions

Quick answers about installing and using Readable.

What is Readable?

Human-readable numbers, dates, durations and file sizes for Laravel, as static methods, helpers and Blade directives. It's a free, open-source Laravel package by Pharaonic.

How do I install Readable?

Run composer require pharaonic/laravel-readable in your project's root directory.

What does Readable require?

The latest release requires PHP 8.3 – 8.5 and Laravel 13.

Do I need the intl extension?

Only to spell numbers in a language other than English, such as readable_number_in_words(21, 'ar'). English spelling and every other formatter work without it.

Are dates and durations translated?

Yes. Month names, day names and words such as years and before come from Carbon, which follows your application locale.

Why does `readable_compact_number(1500)` print `1K`?

Without decimals the value is truncated to whole units, so a counter never shows more than it has. Pass true to show a rounded decimal: readable_compact_number(1500, true) prints 1.5K.

Is the Blade output escaped?

No. The directives echo the result as is, like {!! !!}, so you can pass HTML entities as a delimiter. Don't pass user input as a delimiter.

Is Readable free to use?

Yes. Readable is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Readable documentation?

Read the Readable documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Readable?

Open an issue or a pull request on GitHub, or ask in the Pharaonic Discord.

Ready to dig in?

Read the full documentation for installation, readable numbers, numbers in words, dates and times, date differences, durations, file sizes, the global helpers, the Blade directives, upgrading from 1.x, and real-world examples.