Package Data | |
---|---|
Maintainer Username: | MasterYuri |
Maintainer Contact: | yuriyg86@gmail.com (Yuriy Guzenko) |
Package Create Date: | 2016-04-10 |
Package Last Update: | 2016-04-10 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-22 03:16:08 |
Package Statistics | |
---|---|
Total Downloads: | 6 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Component get resized images from public (storage) directory.
You upload image and use it for preview:
<img src="{{ asset('img/photo1.jpg') }}" alt="Preview">
<img src="{{ asset($article->preview) }}" alt="Preview">
But usually image is too big so you have to generate smaller files:
<img src="{{ asset('img/photo1_100x100.jpg') }}" alt="Preview">
<img src="{{ asset($article->preview_100x100) }}" alt="Preview">
This library lets you to simplify it and make it on fly:
<img src="{{ pub_review('img/photo1.jpg', 100, 100, "scale") }}" alt="Preview">
<img src="{{ pub_review($article->preview, 100, 100, "scale") }}" alt="Preview">
Also you can configure image that must be shown if requested image doesn't exists.
@todo watermark
Algotitm:
pub_review()
generates url to library controller action.Available modes are 'scale', 'fitin', 'fitout':
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 file is 'pub-preview.php'. It has comments that describe all parameters.
The MIT License (MIT). Please see License File for more information.