PHPackages                             masteryuri/laravel-pub-preview - 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. [Image &amp; Media](/categories/media)
4. /
5. masteryuri/laravel-pub-preview

ActiveLibrary[Image &amp; Media](/categories/media)

masteryuri/laravel-pub-preview
==============================

Get resized image from public directory

16PHP

Since Apr 10Pushed 10y ago1 watchersCompare

[ Source](https://github.com/MasterYuri/Laravel-PubPreview)[ Packagist](https://packagist.org/packages/masteryuri/laravel-pub-preview)[ RSS](/packages/masteryuri-laravel-pub-preview/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel-PubPreview Beta
=======================

[](#laravel-pubpreview-beta)

Component get resized images from public (storage) directory.

You upload image and use it for preview:

```

```

But usually image is too big so you have to generate smaller files:

```

```

This library lets you to simplify it and make it on fly:

```

```

Also you can configure image that must be shown if requested image doesn't exists.

@todo watermark

How it works
------------

[](#how-it-works)

Algotitm:

- `pub_review()` generates url to library controller action.
- Controller checks if it has resized image. If no - it generates resized image and saves it to temporaty directory.
- Controller returns resized image from temporary directory.

Parameters of pub\_review()
---------------------------

[](#parameters-of-pub_review)

- Relative path to image file.
- Require width in pixels.
- Require height in pixels.
- Required resize mode.

Available modes are 'scale', 'fitin', 'fitout':

[![alt tag](https://camo.githubusercontent.com/2858ac17b2593c941852e8f88a5cd3c7f9c775f8903b59f80ffc18f2811aa6fa/687474703a2f2f7a6d6963726f6e2e6f72672f74706c2f636f6d706f6e656e74732f6765745f696d672f6d6f64652e706e67)](https://camo.githubusercontent.com/2858ac17b2593c941852e8f88a5cd3c7f9c775f8903b59f80ffc18f2811aa6fa/687474703a2f2f7a6d6963726f6e2e6f72672f74706c2f636f6d706f6e656e74732f6765745f696d672f6d6f64652e706e67)

Installation
------------

[](#installation)

Via Composer

```
$ composer require masteryuri/laravel-pubpreview
```

Add service provider into `/config/app.php`:

```
'MasterYuri\PubPreview\ServiceProvider',

```

Publish config and resources:

```
php artisan vendor:publish --provider="MasterYuri\PubPreview\ServiceProvider"

```

Configuration
-------------

[](#configuration)

Configuration file is 'pub-preview.php'. It has comments that describe all parameters.

[Read configuration file](config/pub-preview.php)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16851673?v=4)[Yuri Guzenko](/maintainers/MasterYuri)[@MasterYuri](https://github.com/MasterYuri)

---

Top Contributors

[![yuriyg86](https://avatars.githubusercontent.com/u/3150407?v=4)](https://github.com/yuriyg86 "yuriyg86 (2 commits)")

### Embed Badge

![Health badge](/badges/masteryuri-laravel-pub-preview/health.svg)

```
[![Health](https://phpackages.com/badges/masteryuri-laravel-pub-preview/health.svg)](https://phpackages.com/packages/masteryuri-laravel-pub-preview)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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