PHPackages                             vish4395/laravel-file-viewer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. vish4395/laravel-file-viewer

ActiveLibrary[File &amp; Storage](/categories/file-storage)

vish4395/laravel-file-viewer
============================

A basic file viewer for Laravel projects

1.0.4(8mo ago)17324.5k—0%28MITJavaScriptPHP ^7.4|^8.0

Since Jan 3Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/vish4395/laravel-file-viewer)[ Packagist](https://packagist.org/packages/vish4395/laravel-file-viewer)[ Docs](https://github.com/vish4395/laravel-file-viewer)[ RSS](/packages/vish4395-laravel-file-viewer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

🖼️ Laravel File Viewer
======================

[](#️-laravel-file-viewer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7a6c167580777d64413e3330a256fe7abeadc263e425acd888cddc0afd0b151a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76697368343339352f6c61726176656c2d66696c652d7669657765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vish4395/laravel-file-viewer)[![Total Downloads](https://camo.githubusercontent.com/8be2f1af0a1f3ae00b7999dae5d423a381ec550fe6288b55c180fdb8d2d8dfa9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76697368343339352f6c61726176656c2d66696c652d7669657765722e7376673f7374796c653d666c61742d73717561726526636f6c6f723d627269676874677265656e)](https://packagist.org/packages/vish4395/laravel-file-viewer)[![GitHub](https://camo.githubusercontent.com/35e6c077b38562b0b4189a07378dffe6b00b231802299d68fda86c6614b49f1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f76697368343339352f6c61726176656c2d66696c652d7669657765723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/35e6c077b38562b0b4189a07378dffe6b00b231802299d68fda86c6614b49f1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f76697368343339352f6c61726176656c2d66696c652d7669657765723f7374796c653d666c61742d737175617265)[![GitHub Stars](https://camo.githubusercontent.com/a1ef4b887c7c6b4e58e12d338325277b6fd89c2751981a3df7ea2b3146746ec8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f76697368343339352f6c61726176656c2d66696c652d7669657765723f7374796c653d666c61742d737175617265)](https://github.com/vish4395/laravel-file-viewer/stargazers)[![Twitter URL](https://camo.githubusercontent.com/bb721d10fbf2eb55123ca3479b4c4a7deb212c6a15280a6266841a594cf29dde/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c3f636f6c6f723d626c7565266c6f676f3d74776974746572267374796c653d666c61742d7371756172652675726c3d68747470732533412532462532466769746875622e636f6d25324676697368343339352532466c61726176656c2d66696c652d766965776572253246)](https://twitter.com/intent/tweet?text=Checkout%20this%20awesome%20package%0Ahttps%3A//github.com/vish4395/laravel-file-viewer/)

[![Laravel File Viewer](laravel-file-viewer.png)](laravel-file-viewer.png)

**Laravel File Viewer** is the easiest way to preview images, videos, audio, PDF, DOCX, PPTX, XLSX, and more in your Laravel app. Instantly add beautiful file previews to your admin panels, dashboards, or user portals.

---

> **✨ Loved by developers. Easy to install. Works out of the box.**

---

🚦 Features
----------

[](#-features)

- 📄 Preview images, videos, audio, PDF, DOCX, PPTX, XLSX, and more
- ⚡️ Super simple integration—just one line in your controller!
- 🎨 Customizable UI (publish and tweak the views)
- 🛡️ Secure: works with Laravel's storage disks
- 🌍 Multilingual ready

---

🛠️ Installation
---------------

[](#️-installation)

Install via Composer:

```
composer require vish4395/laravel-file-viewer
```

Publish assets:

```
php artisan vendor:publish --provider="Vish4395\LaravelFileViewer\LaravelFileViewerServiceProvider" --tag=assets
```

Publish views (optional, for UI customization):

```
php artisan vendor:publish --provider="Vish4395\LaravelFileViewer\LaravelFileViewerServiceProvider" --tag=views
```

---

🚀 Quick Start
-------------

[](#-quick-start)

Add the alias in your `config/app.php` (Laravel 10 and below):

```
'aliases' => Facade::defaultAliases()->merge([
    'LaravelFileViewer' => Vish4395\LaravelFileViewer\LaravelFileViewerFacade::class,
])->toArray(),
```

### Example Controller

[](#example-controller)

```
use Illuminate\Http\Request;
use Vish4395\LaravelFileViewer\LaravelFileViewer;

class FilePreviewController extends Controller
{
    public function filePreview($fileName){
        $filePath = $fileName;
        $disk = 'public';
        $fileUrl = asset('storage/' . $fileName);
        $fileData = [
            [
                'label' => __('Label'),
                'value' => "Value"
            ]
        ];
        return LaravelFileViewer::show($fileName, $filePath, $fileUrl, $disk, $fileData);
    }
}
```

Add a route in `routes/web.php`:

```
Route::get('/file-preview/{fileName}', [FilePreviewController::class, 'filePreview']);
```

---

🌟 Why Laravel File Viewer?
--------------------------

[](#-why-laravel-file-viewer)

- **Save hours**: No need to integrate multiple JS libraries yourself.
- **Modern UI**: Looks great out of the box.
- **Flexible**: Works with any Laravel storage disk.
- **Trusted**: Used in production by agencies and startups.

---

📈 Help Us Grow!
---------------

[](#-help-us-grow)

If you find this package useful:

- ⭐ Star this repo on GitHub
- 📦 Try it in your next Laravel project
- 🐦 Tweet about it [@vish4395](https://twitter.com/vish4395)
- 💬 Share feedback and suggestions

---

📋 Changelog
-----------

[](#-changelog)

See [CHANGELOG](CHANGELOG.md) for recent updates.

---

🤝 Contributing
--------------

[](#-contributing)

PRs are welcome! See [CONTRIBUTING](CONTRIBUTING.md) for details. Questions? Email  or open an issue.

---

🔒 Security
----------

[](#-security)

If you discover any security issues, please email  instead of using the issue tracker.

---

👏 Credits
---------

[](#-credits)

- [Vishal Sharma](https://github.com/vish4395)
- [meshesha/officetohtml](https://github.com/meshesha/officetohtml)
- [VolodymyrBaydalka/docxjs](https://github.com/VolodymyrBaydalka/docxjs)
- [All Contributors](../../contributors)

---

📄 License
---------

[](#-license)

MIT. See [License File](LICENSE.md) for details.

---

🎬 Demo
------

[](#-demo)

    AwesomeScreenshot-1\_2\_2023.1.32.27PM.mp4    ---

⭐ Star History
--------------

[](#-star-history)

[![Star History Chart](https://camo.githubusercontent.com/15672ee262599da7b6135fa15f16a3a6891f6cd75d62ba35a81184e8405c121e/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d76697368343339352f6c61726176656c2d66696c652d76696577657226747970653d54696d656c696e65)](https://www.star-history.com/#vish4395/laravel-file-viewer&Timeline)

---

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance60

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~326 days

Total

4

Last Release

251d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f765a4256dc69994ef569b1e8c149d79987a735d7e95bae2e796e5eb51712730?d=identicon)[vish4395](/maintainers/vish4395)

---

Top Contributors

[![vish4395](https://avatars.githubusercontent.com/u/12929023?v=4)](https://github.com/vish4395 "vish4395 (24 commits)")

---

Tags

vish4395laravel-file-viewer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vish4395-laravel-file-viewer/health.svg)

```
[![Health](https://phpackages.com/badges/vish4395-laravel-file-viewer/health.svg)](https://phpackages.com/packages/vish4395-laravel-file-viewer)
```

###  Alternatives

[overtrue/laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

482229.7k16](/packages/overtrue-laravel-filesystem-qiniu)[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)[overtrue/laravel-filesystem-cos

A Cos storage filesystem for Laravel.

92128.4k7](/packages/overtrue-laravel-filesystem-cos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
