https://github.com/solutionforest/filament-simplelightbox
Filament SimpleLightbox is a PHP package that provides a simple and lightweight solution for implementing a lightbox feature in your Filament admin panel. It allows you to easily preview Image, PDF and Office documents within your Filament.
https://github.com/solutionforest/filament-simplelightbox
filament-plugin filamentphp fslightbox lightbox office-viewer pdf-viewer
Last synced: 6 months ago
JSON representation
Filament SimpleLightbox is a PHP package that provides a simple and lightweight solution for implementing a lightbox feature in your Filament admin panel. It allows you to easily preview Image, PDF and Office documents within your Filament.
- Host: GitHub
- URL: https://github.com/solutionforest/filament-simplelightbox
- Owner: solutionforest
- License: mit
- Created: 2023-11-09T08:01:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-28T04:00:15.000Z (7 months ago)
- Last Synced: 2025-07-28T06:10:49.182Z (7 months ago)
- Topics: filament-plugin, filamentphp, fslightbox, lightbox, office-viewer, pdf-viewer
- Language: PHP
- Homepage:
- Size: 194 KB
- Stars: 61
- Watchers: 2
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
## About Solution Forest
[Solution Forest](https://solutionforest.com) Web development agency based in Hong Kong. We help customers to solve their problems. We Love Open Soruces.
We have built a collection of best-in-class products:
- [InspireCMS](https://inspirecms.net): A full-featured Laravel CMS with everything you need out of the box. Build smarter, ship faster with our complete content management solution.
- [Filaletter](https://filaletter.solutionforest.net): Filaletter - Filament Newsletter Plugin
- [Website CMS Management](https://filamentphp.com/plugins/solution-forest-cms-website): A hands-on Filament CMS plugin for those who prefer more manual control over their website content management.
# Filament SimpleLightbox
[](https://packagist.org/packages/solution-forest/filament-simplelightbox)
[](https://packagist.org/packages/solution-forest/filament-simplelightbox)
## Description
Filament SimpleLightbox is a PHP package that provides a simple and lightweight solution for implementing a lightbox feature in your Filament admin panel. It allows you to easily preview Image, PDF and Office documents within your Filament.
## Features
- Integration with the [fslightbox](https://github.com/banthagroup/fslightbox "fslightbox") JavaScript library for the lightbox functionality.
- Supports previewing PDF and Office documents. [information](https://gist.github.com/theel0ja/b9e44a961f892ccf43e217ab74b9417b "information")
- Easy installation and usage.
## Installation
| Filament Version | Filament Simple Light Box Version |
|------------------|---------------------------|
| v3.x | v0.x |
| v4.x | v1.x
You can install the package via composer:
```bash
composer require solution-forest/filament-simplelightbox
```
Publish the assets:
```bash
php artisan filament:assets
```
```bash
php artisan optimize
```
## Usage
```php
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(SimpleLightBoxPlugin::make())
}
```
```php
Tables\Columns\ImageColumn::make('image')
->simpleLightbox()
```
```php
Tables\Columns\TextColumn::make('pdf_url')
->simpleLightbox("Your Url address"),
```
You can pass parameter to generate url, also the url can be used as default value (`defaultDisplayUrl` default is true):
```php
Tables\Columns\ImageColumn::make('image')
->simpleLightbox(fn ($record) => $record?->image ?? "Your Image Url address", defaultDisplayUrl: true),
```
```php
Tables\Columns\TextColumn::make('url')
->simpleLightbox(fn ($record) => $record?->image ?? "Your Image Url address", defaultDisplayUrl: true),
```
```php
InfoLists\Components\ImageEntry::make('image')
->simpleLightbox(fn ($record) => $record?->image ?? "Your Image Url address", defaultDisplayUrl: true),
```
```php
Tables\Columns\ImageColumn::make('image')
->simpleLightbox(fn ($record) => $record?->image ?? "Your Image Url address", defaultDisplayUrl: true),
```
## Preview
https://github.com/solutionforest/Filament-SimpleLightBox/assets/68211972/8bd7b59f-d18b-4f58-911f-822f10cb879b




## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [alan](https://github.com/solutionforest)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
