Download the PHP package kakposoe/laravel-placeholder-image without Composer
On this page you can find all versions of the php package kakposoe/laravel-placeholder-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kakposoe/laravel-placeholder-image
More information about kakposoe/laravel-placeholder-image
Files in kakposoe/laravel-placeholder-image
Package laravel-placeholder-image
Short Description A laravel placeholder image
License MIT
Informations about the package laravel-placeholder-image
Laravel Placeholder Image
A convenient laravel facade which returns a placeholder image url.
- Installation
- Register Plugin (Laravel 5.5 and below)
- How to use
- Other image types
- A note about production envs
Installation
Install via composer
Register Service Provider
If you use Laravel < 5.5, Add service provider to config/app.php
in providers
section
Register Facade
If you use Laravel < 5.5, register package facade in config/app.php
in aliases
section
Publish Configuration File
How to use
You can get a placeholder image url within your blade templates by adding:
By default, images will be returned as a 600px x 400px image.
To change the dimensions of the image, simply add the $width
and $height
like so:
Other image types
There are several different types of image at your disposal:
Profile Image
To get a profile image placeholder:
Icon image
You are able to create a placeholder image with a font-awesome icon in the middle:
Note: By default, the fa-image
icon will be returned.
Blurry image
To return a blurry image:
Keyword search
You can return a placeholder url based on a keyword:
Placeholder with image dimensions
An placeholder image url which has the image dimensions can be returned using the ::dimensions()
method:
A note about production environments
As these are placeholder images, it is assumed that these should not to be used within production environments.
All placeholder images used in production will be replaced with an ::icon()
placeholder image, avoiding showing inappropriate images and the impression that the image could not be found.